Step 1: expose a public URL
GitHub and Slack can’t reachlocalhost. Use ngrok to tunnel your local server:
https://abc123.ngrok-free.app. Copy it.
Get a stable URL (recommended)
Free ngrok accounts get a random URL on every restart, so you’d have to re-register your webhook every time. Claim a free static domain at dashboard.ngrok.com/domains and it’ll never change.
Step 2: create the webhook endpoint
Add one route to your server. All plugins share this single URL:app/api/webhook/route.ts
processWebhook handles everything: it identifies which plugin sent the event, verifies the signature, updates your local database, and runs your hooks.
Step 3: register and react
- GitHub
- Slack
Register in GitHub:React to events:
- Go to your repo, then Settings, Webhooks, Add webhook
- Set Payload URL:
https://your-ngrok-url.ngrok-free.app/api/webhook - Set Content type:
application/json - Add a Secret, then save it
- Choose events (or “Send me everything”)
- Click Add webhook
createCorsair. Corsair uses it to verify incoming webhook signatures.corsair.ts
corsair.ts
How it works
processWebhook returns plugin and action for the webhook that matched (plugin is null when none did), and a response to send back:
Set
responseHeaders on the HTTP response too: a few providers (Asana’s X-Hook-Secret handshake) need them.
With multiTenancy, a URL that names no tenantId doesn’t fall back to the default tenant blindly. Corsair asks the plugin that matched which account the delivery belongs to and uses the tenant linked to it. It uses default only when no tenant is linked, and refuses the delivery with a 500 if the lookup itself fails.
What’s next
Workflows
Chain webhook events into multi-step automations.
Multi-tenancy
Scope incoming webhooks per user with ?tenantId= param.
GitHub webhooks
All available GitHub events and payload shapes.
Slack webhooks
All available Slack events and payload shapes.