Slack
Overviewβ
Send notifications to a Slack channel.About Slack Notifierβ
The Slack notifier allows you to get notification on your favorite slack channel when an instance of go-feature-flag is detecting changes in the configuration file.

Each notification lists the flags that were created, updated or deleted. For an updated flag, every change is described as a short sentence, for example:
βοΈ Flag "dark-mode" updated
β’ Version set to `2`
β’ Targeting rule `beta-users` now matches `beta eq true or company eq "acme"` (was `beta eq true`)
β’ Targeting rule `internal` added: serves `enabled` when `email ew "@example.com"`
β’ Default rule now serves `disabled` 50%, `enabled` 50% (was `disabled` 90%, `enabled` 10%)
A flag shows at most 50 changes, and a last line counts the changes left out.
Configure Slack Notificationβ
- First, you need to create an incoming webhook on your slack instance. You can follow this documentation to see how to do it
- Copy your webhook URL.
It should look like:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX. - Now you can configure your notifier
Configure the relay proxyβ
To configure your relay proxy to use the Slack notifier, you need to add the following configuration to your relay proxy configuration file:
goff-proxy.yaml
# ...
notifier:
- kind: slack
webhookUrl: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
# ...
| Field name | Mandatory | Type | Default | Description |
|---|---|---|---|---|
kind | string | none | Value should be slack.This field is mandatory and describe which retriever you are using. | |
webhookUrl | string | none | The complete URL of your incoming webhook configured in Slack. |
Configure the GO Moduleβ
To configure your GO module to use the Slack notifier, you need to add the following
configuration to your ffclient.Config{} object:
example.go
err := ffclient.Init(ffclient.Config{
// ...
Notifiers: []notifier.Notifier{
&slacknotifier.Notifier{
SlackWebhookURL: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
},
// ...
},
})
defer ffclient.Close()
| Field | Mandatory | Description |
|---|---|---|
SlackWebhookURL | The complete URL of your slack webhook. |