Skip to content

Configuring Slack Integration

Arnold Noronha edited this page Aug 9, 2021 · 2 revisions

The Slack integration is triggered after a screenshot change has already landed in your main or master branch. We call such integrations task integrations, because most of the other such integrations actually work with project management tools such as Asana.

To set up Slack, you need to go through three steps.

Create a Slack application

First you need to create a Slack application. Go to Basic Information -> Add features and functionality -> Permissions. Give the application the chat:write OAuth scope. We also suggest chat:write.public to avoid having to add the app to each channel.

Also make sure the Redirect URLs is set up. You shouldn't need public-facing domains for this to work, it should be okay to use internal or even http://localhost:xxxx.

Go to Basic Information, and look at the App Credentials section. You will need the Client ID, and the Client Secret for the next step.

You don't have to add the app to your organization at this point, although it wouldn't hurt.

Configuring the Slack plugin

Once you've created your app, you need to provide the Client ID and Client Secret to screenshotbot. For this update config.lisp, and add a plugin. The following example shows a config where only one plugin is installed, but there may be other plugins installed along with Slack.

(setf (installation)
   (make-instance 'installation
      :plugins (list (make-instance 
                        'screenshotbot/slack:slack-plugin
                        :client-id "<your-client-id>"
                        :client-secret "<your-client-secret>"))))

At this point, you can either restart Screenshotbot, or go to the Admin menu and click *Reload config.lisp". After this change, a new option should show up in your Settings page (not the Admin page: the Admin page is for site admins, and the Settings page is for consumers).

Configuring the Slack integration in the UI

Once you've set up the Slack plugin, click your organization name at the bottom left, click Settings, and click Slack. You should see an Add to Slack button. Click that, follow the follow. Specify the Slack Default Channel where you want messages to send, and enable the checkbox to for Slack Notifications.

Test your configuration

At this point you should be done. Click the Test button to make sure your slack configuration is working. If you commit any changes to your repository you'll get notified on Slack with a link to the report.