server.mjs
1
Deploy the function
Deploy it so it is reachable at an HTTPS address, for example
https://hooks.example.com/darwin. Set SLACK_WEBHOOK_URL now; you’ll get DARWIN_WEBHOOK_SECRET in the next step.2
Add the endpoint in Darwin
In Integrations → API → Webhooks, select Add endpoint, paste the address, choose only
handoff.requested, and select Add endpoint. Copy the signing secret into DARWIN_WEBHOOK_SECRET and redeploy.3
Test it
Select Send test event in the endpoint’s menu. Darwin should report a
200. The test event’s type is webhook.test, so nothing is posted to Slack.It worked if, after someone asks the chat on your live site to talk to a person, a message appears in the channel within a few seconds.meeting.booked to a sales channel or lead.captured to an SDR queue: subscribe to the type and read data.object. See Webhooks for every payload.