- Docker Compose
- A Slack App with Event Subscriptions enabled
- An ngrok account (free tier works)
- Go to api.slack.com/apps and click Create New App
- Choose From scratch, pick a name and workspace
- Under Basic Information → App Credentials, copy the Signing Secret
docker compose --profile dev upThis starts NATS, the Slack webhook receiver, and ngrok. Find the public tunnel URL in the ngrok container logs:
docker compose logs ngrokLook for the slack tunnel URL (e.g. https://def456.ngrok-free.app).
- In your Slack App settings, go to Event Subscriptions
- Toggle Enable Events to On
- Set the Request URL to
https://<ngrok-url>/webhook - Slack will send a
url_verificationchallenge — the server responds automatically - Under Subscribe to bot events, add the events you need:
message.channels— public channelsmessage.groups— private channelsmessage.im— direct messagesapp_mention— @mentions anywhere
- Click Save Changes
- Go to Interactivity & Shortcuts
- Toggle Interactivity to On
- Set the Request URL to the same
https://<ngrok-url>/webhook - Click Save Changes
Block actions, modal submissions, and shortcuts will be published to NATS on
slack.interaction.{type} subjects (e.g. slack.interaction.block_actions).
- Go to Slash Commands and click Create New Command
- Set the Request URL to the same
https://<ngrok-url>/webhook - Fill in the command name, description, and usage hint
- Click Save
Slash commands will be published to NATS on slack.command.{command_name}
subjects (e.g. slack.command.trogon).
- Go to OAuth & Permissions
- Under Scopes → Bot Token Scopes, ensure you have the scopes required by the events you subscribed to
- Click Install to Workspace and authorize
Send a message in a channel where the app is installed. You should see:
- The webhook receiver log the incoming event
- The event published to NATS on
slack.event.message
You can inspect NATS with:
nats sub -s nats://nats.trogonai.orb.local:4222 "slack.>"Without --profile dev, ngrok is excluded and only the core services start.
| Slack payload | NATS subject | X-Slack-Payload-Kind header |
|---|---|---|
Events API (event_callback) |
slack.event.{event.type} |
event |
| Interactions (block actions, modals) | slack.interaction.{type} |
interaction |
| Slash commands | slack.command.{command_name} |
command |
| Variable | Required | Default | Description |
|---|---|---|---|
SLACK_SIGNING_SECRET |
yes | — | Slack app signing secret |
NGROK_AUTHTOKEN |
yes (dev profile) | — | ngrok auth token |
SLACK_WEBHOOK_PORT |
no | 3000 |
HTTP port for the webhook receiver |
SLACK_SUBJECT_PREFIX |
no | slack |
NATS subject prefix |
SLACK_STREAM_NAME |
no | SLACK |
JetStream stream name |
SLACK_STREAM_MAX_AGE_SECS |
no | 604800 |
Max message age in seconds (default 7 days) |
SLACK_NATS_ACK_TIMEOUT_SECS |
no | 10 |
NATS acknowledgement timeout in seconds |
SLACK_MAX_BODY_SIZE |
no | 1048576 |
Max HTTP request body size in bytes (default 1 MB) |
SLACK_TIMESTAMP_MAX_DRIFT_SECS |
no | 300 |
Max allowed clock drift in seconds (default 5 min) |
RUST_LOG |
no | info |
Log level |