Skip to main content
webhookSource() from @trigger.dev/slack verifies the HMAC-SHA256 signature Slack sends in x-slack-signature on every request.
/trigger/slack.ts
To run a subscriber only for some events, add a filter on event.event.type.

Set up Slack

  1. Start trigger dev or deploy, then copy the endpoint’s Webhook URL from the Webhooks page.
  2. In your Slack app’s settings, set the Event Subscriptions request URL to the webhook URL and subscribe to the bot events your subscribers need.
  3. Copy the app’s Signing Secret from Basic Information > App Credentials, then choose Set signing secret on the Trigger.dev endpoint.
  4. Back on the Event Subscriptions page, choose Retry. Slack’s url_verification challenge is answered by the endpoint once the secret is set.
  5. Install the app to your workspace, or reinstall it if the bot events need new scopes. Slack only delivers events the workspace has authorized.
  6. Send a test event from Slack, or use the endpoint’s Test tab, and check the endpoint’s Deliveries tab. See Verify the connection if nothing arrives.

Build a Slack agent

To answer messages in Slack with a chat.agent, use the slack() connector on the same endpoint. It handles streaming replies, status updates and approvals. See Slack agents.