Slack Integration
You can integrate FeatureHub with Slack to receive feature updates directly into a Slack channel.
For Open Source version there is a pre-condition to set an encryption key |
FeatureHub Slack Integration
-
Firstly, you will need to enable Slack Integration in the System Config page. This is a global Slack setup page, which will help you to connect FeatureHub organisation (or deployed instance of Open Source version) with Slack. This can be accessed by users with Super Admin permission.
For Open Source version only, ensure you have provided correct website URL for your FeatureHub app in the Site Configuration section of the System Configuration page. -
Click "Connect FeatureHub to Slack" button, this will redirect you to Slack app installation in your workspace. Make sure you are logged in as your workspace Slack admin. Follow the instructions to add FeatureHub app to your workspace. For FeatureHub Open Source you will be asked to create the app from a manifest:
For Open Source version you will have to complete an extra step by selecting "Install to Workspace".
-
Follow instructions to allow access
-
Once the app is installed, copy the Bot User OAuth Token (only for FeatureHub Open Source installation)
and paste it into the field in the FeatureHub Slack Configuration form
-
Provide Slack channel ID where you would like the notifications to go to. You can find and copy it from the Channel Details menu in your Slack workspace. This will be your default channel ID, but you can override it for each application/environment later. Once you set this up, don’t forget to enable your global configuration by ticking the box "Enabled" and by saving the form.
-
Go to the Integrations tab on the Application Settings page, then select an environment and "Integration type: Slack" from the drop-down. Here you can enable Slack message delivery and if required override the default channel ID set in the previous step.
If you are sending Slack updates to a private channel, you may need to invite @FeatureHub bot first. To send an invitation, type @featurehub and press send. |
You should now be able to receive Slack updates. Message delivery status log is available to indicate any errors in the case of unsuccessful message delivery.
Configuring your own message
The Slack message is a transformed variant of the "Difference Payload" that FeatureHub emits when a feature changes. This payload is documented using OpenAPI here.
The payload is transformed and the format used is the DEFAULT_MESSAGE_FORMAT
documented in the
code.
If there is a demand we can provide an in-situ override capability, but the best way to get flexibility in the message to Slack is to use the Offloading capability below.
Offloading Slack delivery to an external app (FeatureHub Open Source only)
If you would like to customise Slack messages or perform any other additional operations with raw FeatureHub events, there is an option to use an external service that you can build yourself. You can connect your service by providing a URL and additional headers on the Slack System Config page.
FeatureHub provides a sample stack that would allow you to run an external service such as:
-
an AWS lambda
-
a GCP cloud function
-
a Knative express service
You get complete control over how messages are formatted and delivered if you do this.
The sample repository and code is here.