webhookSource() from @trigger.dev/slack verifies the HMAC-SHA256 signature Slack sends in x-slack-signature on every request.
/trigger/slack.ts
event.event.type.
Set up Slack
- Start
trigger devor deploy, then copy the endpoint’s Webhook URL from the Webhooks page. - 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.
- Copy the app’s Signing Secret from Basic Information > App Credentials, then choose Set signing secret on the Trigger.dev endpoint.
- Back on the Event Subscriptions page, choose Retry. Slack’s
url_verificationchallenge is answered by the endpoint once the secret is set. - Install the app to your workspace, or reinstall it if the bot events need new scopes. Slack only delivers events the workspace has authorized.
- 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 achat.agent, use the slack() connector on the same endpoint. It handles streaming replies, status updates and approvals. See Slack agents.
