Skip to main content
This guide connects your self-hosted instance to a Slack workspace, so people can mention @Compiler with a question and get the answer in the thread. You create a Slack app of your own and give Compiler its credentials in Settings > Slack. Nothing goes in environment variables, and nothing needs a restart.

Prerequisites

  • You’re an owner or admin of your Compiler organization.
  • You can create apps in your Slack workspace. Some workspaces need an admin to approve a new app.
  • PUBLIC_URL is set to the address your instance is reached on, such as https://compiler.yourdomain.com. Slack sends questions to that address, so it has to be reachable from the internet over HTTPS. The Slack page in settings tells you if it’s missing.

Step 1: Create the Slack app

  1. In Compiler, open Settings > Slack.
  2. Click Create the Slack app. Slack opens with a manifest already filled in, pointing at your instance.
  3. Choose your workspace and create the app.
If the button doesn’t suit you, click Copy manifest instead, go to api.slack.com/apps, choose Create New App > From a manifest, and paste it. The manifest asks for these permissions and no more: The manifest also turns on Slack’s agent features for the app. It appears under Agents in the Slack sidebar with a split-view pane and suggested prompts, shows a “working” indicator with a Stop button while it answers, and streams its reply.
Slack doesn’t let workspace guests use agent-enabled apps.
Compiler only acts on messages in threads it has already answered in. Other channel messages are acknowledged and dropped. The manifest also turns on interactivity, pointed at /api/slack/interactivity. Slack sends clicks on the bot’s project picker there.

Step 2: Give Compiler the credentials

In your new Slack app, open Basic Information and find App Credentials. Copy these three into Settings > Slack in Compiler and click Save: Both secrets are stored encrypted. Afterwards, Compiler only shows their last four characters. To change the credentials later, type the new values into the fields and click Save. Leave a secret field blank to keep the current secret.

Step 3: Let Slack verify the address

Slack only sends events to an address it has verified, and it couldn’t verify yours before Compiler had the Signing Secret.
  1. In your Slack app, open Event Subscriptions.
  2. Next to the Request URL, click Retry. It should change to Verified.
  3. Save the page if Slack asks you to.
If it doesn’t verify, check that PUBLIC_URL is right and that https://compiler.yourdomain.com/api/slack/events is reachable from the internet. Slack also needs to reach https://compiler.yourdomain.com/api/slack/interactivity for the project picker to work.

Step 4: Add Compiler to your workspace

Back in Settings > Slack, click Add to Slack, choose the workspace and approve.
Do this from Compiler, not with the Install to Workspace button on the app’s page at api.slack.com. That button installs the app without telling Compiler, and questions from the workspace are then dropped.
The page now shows the connected workspace. Invite the bot to a channel with /invite @Compiler, or message it directly.

Optional: add an icon

A manifest can’t carry an icon, so the app starts with Slack’s placeholder. To give it one, open the app’s Basic Information, scroll to Display Information and upload an image.

Who can ask, and what they can see

Anyone in the connected workspace can ask a question. Questions from Slack are asked by a Compiler account that belongs to your organization, called Compiler for Slack, so an answer can draw on every project in the organization, whoever asked. Each question is about one project. If your organization has more than one project, the bot asks which one in the thread. Tick Remember for this channel to keep that choice, or say project to the bot to change it. You can also set or clear a channel’s project under Channel projects in Settings > Slack. Each answer links to the full conversation in Compiler. Opening that link needs a Compiler login in your organization.

Disconnect

Click Disconnect in Settings > Slack, then Disconnect now. Compiler removes itself from the workspace. Conversations it already had stay in Compiler, and links to them keep working. You can then remove the credentials as well: next to Remove the credentials, click Remove. Or leave them in place to reconnect later. Compiler only offers to remove them while no workspace is connected.

Update an existing app

When a new version of Compiler asks for more permissions, the manifest changes. Settings > Slack then shows Reconnect for new permissions, with the permissions your workspace hasn’t granted yet.
  1. Next to App manifest, click Copy manifest.
  2. Open the app’s App Manifest page at api.slack.com, replace the manifest with the one you copied, and save.
  3. Back in Compiler, click Reconnect and approve the new permissions in Slack.
Nothing else needs redoing.