{"id":17433,"library":"ember-cli-deploy-slack","title":"Ember CLI Deploy Slack Plugin","description":"ember-cli-deploy-slack is an ember-cli-deploy plugin designed to send deployment notifications to Slack. It integrates deeply into the `ember-cli-deploy` pipeline, providing hooks to send customizable messages for various stages such as `didDeploy` and `didFail`. The current stable version is 2.0.0, which includes updated dependencies and Node.js version requirements. As an Ember CLI Deploy plugin, its release cadence is typically aligned with the broader Ember ecosystem and major dependency updates. Its key differentiator is its seamless integration with the `ember-cli-deploy` context, allowing dynamic message generation using deployment-specific data, and leveraging `node-slackr` for flexible Slack message formatting.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ember-cli-deploy/ember-cli-deploy-slack","tags":["javascript","ember-addon","ember-cli-deploy-plugin"],"install":[{"cmd":"npm install ember-cli-deploy-slack","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-deploy-slack","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-deploy-slack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core deployment system; this package is a plugin for it.","package":"ember-cli-deploy","optional":false},{"reason":"Underlying utility used for sending messages to Slack.","package":"node-slackr","optional":false}],"imports":[{"note":"This plugin is configured via the `slack` key within your `config/deploy.js` file, not through direct ES module imports in application code. The configuration object itself serves as the primary interface to the plugin's functionality.","wrong":"import Slack from 'ember-cli-deploy-slack'","symbol":"slack configuration","correct":"ENV.slack = { webhookURL: '...' }"},{"note":"Custom message functions for deployment hooks (e.g., `didDeploy`, `didFail`) must return a function that takes the `slack` notifier as an argument. This inner function then calls `slack.notify` to send the message, allowing access to the full deployment `context`.","wrong":"ENV.slack.didDeploy = 'Deployment complete!'","symbol":"Custom Hook Functions","correct":"ENV.slack.didDeploy = function(context) { return function(slack) { return slack.notify({ text: '...' }); } }"}],"quickstart":{"code":"// config/deploy.js\nmodule.exports = function(deployTarget) {\n  var ENV = {\n    slack: {\n      webhookURL: process.env.SLACK_WEBHOOK_URL ?? 'YOUR_SLACK_WEBHOOK_URL', // Use env var for security\n      channel: '#deployments',\n      username: 'EmberDeployBot',\n      iconEmoji: ':rocket:',\n      // Example of a custom message for successful deployments\n      didDeploy: function(context) {\n        return function(slack) {\n          const projectName = context.project.name();\n          return slack.notify({\n            text: `:white_check_mark: ${projectName} deployed to ${deployTarget}!`, \n            attachments: [\n              { text: `Revision: ${context.revisionData.revisionKey}` }\n            ]\n          });\n        };\n      }\n    }\n  };\n\n  if (deployTarget === 'production') {\n    ENV.slack.channel = '#production-deploys';\n  }\n  return ENV;\n};\n\n// Terminal\n// $ ember install ember-cli-deploy-slack\n// $ SLACK_WEBHOOK_URL=\"https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX\" ember deploy production","lang":"javascript","description":"Installs the plugin, configures a basic Slack webhook and custom `didDeploy` message in `config/deploy.js` with environment variable handling for the webhook URL, and demonstrates running a production deployment."},"warnings":[{"fix":"Ensure your Node.js environment meets the new requirements (Node.js 14, 16, 18, or >=20). Update all `ember-cli-deploy` related dependencies to their latest compatible versions to prevent conflicts.","message":"Version 2.0.0 introduces breaking changes by updating internal dependencies and raising the minimum Node.js version requirements. Earlier Node.js versions (e.g., Node 12) are no longer supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use `process.env.YOUR_ENV_VAR ?? ''` for `webhookURL` and other sensitive data within your `config/deploy.js` to prevent accidental exposure and improve security.","message":"Sensitive configuration values like `webhookURL` should be managed via environment variables and *not* hardcoded directly into `config/deploy.js`.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Verify the `webhookURL` in your `config/deploy.js` file (or the environment variable it reads from), ensuring it's a valid and active Slack incoming webhook URL. Check for typos or missing parts of the URL.","cause":"The `webhookURL` configured in `config/deploy.js` is either missing, malformed, or has been revoked in Slack.","error":"Slack notification failed: Invalid webhook URL"},{"fix":"Ensure your custom hook functions follow the pattern `function(context) { return function(slack) { /* call slack.notify here */ }; }`. The `slack` object is only available in the *inner* function.","cause":"A custom hook function (e.g., `didDeploy`, `didFail`) is not correctly returning a function that accepts `slack` as an argument before attempting to call `slack.notify`.","error":"TypeError: slack.notify is not a function"}],"ecosystem":"npm","meta_description":null}