This topic explains how to subscribe to notifications in Slack channels. You can receive notifications when resources are created, updated, deleted, or are ready for removal.
It can be useful to let an entire channel know when a flag changes or is ready to remove. You can receive notifications when someone toggles a flag’s targeting on or off, when someone creates new resources in a certain environment, and when flags are ready for removal from your codebase.
You can subscribe to updates for flags, metrics, projects, or environments. When someone updates a resource or when an alert is triggered, either directly in LaunchDarkly or through the Slack app, LaunchDarkly sends a notification to all channels subscribed to updates for that resource. Subscriptions must have a project, and can optionally include parameters like a specific environment, flag name, status, or tag that will filter the notifications you receive.
There are two ways to create a subscription to flag notifications: the Slack modal workflow or the /launchdarkly subscribe command. Subscriptions created through the modal must specify a project and environment.
To subscribe using the modal:
/launchdarkly subscribe in your Slack client’s text bar and press Enter. The “Create subscription” dialog appears.
* as a wildcard in your flag key. You’ll only receive updates for flags that match these parameters.
There are two ways to subscribe to updates using the command: with keyword arguments (recommended), or with positional arguments. To view more information and examples of the subscribe command, run /launchdarkly help subscribe in a channel that the LaunchDarkly bot is in.
You can use keyword arguments to create a subscription with any combination of parameters. At least one parameter is required.
Here’s how:
/launchdarkly subscribe and pass in any combination of the following arguments:
-p or --project=-e or --environment=-f or --flag_key=-s or --status=-a or --action=-t or --tag=For example, the following command creates a subscription for all flags in the qa environment of the chatbot project, with status active and tag production:
You can use positional arguments to create a subscription for a single flag. You must provide all three arguments.
Here’s how:
/launchdarkly subscribe and provide in order the project, environment, and flag key of the flag you would like to subscribe to.For example, the following command creates a subscription for the chat-response flag in the qa environment of the chatbot project:
You can view and remove subscriptions in a Slack channel using the /launchdarkly list command:
/launchdarkly list and press Enter. A list of subscriptions for the channel appears.
The output of the /launchdarkly list command.
Flag notifications include the following information:
To display additional information about the flag change, click View details.
The table below explains the different subscription parameters:
Approvals are only available to customers on select plans. To learn more, read about our pricing. To upgrade your plan, contact Sales.
Requiring approvals by environment is available only to customers on an Enterprise plan. To learn more, read Configuring approvals for an environment.
If your organization uses release management tools and the Slack app, you receive a direct message in Slack when someone requests an approval from you, or when an approval request you made is approved, denied, or receives a comment.
You cannot interact with an approval from these notifications. They are indicators that you should log into LaunchDarkly and review your approval requests.
To learn more about approval requests, read Approvals.