Skip to main content
Webhooks let external services push events to you the moment something happens — a GitHub star, a Slack message, a PR merged. You expose one endpoint. Corsair verifies the signature, identifies the plugin, and calls your handler. Three steps: ngrok → register → react.

Step 1 — Expose a public URL

GitHub and Slack can’t reach localhost. Use ngrok to tunnel your local server:
You’ll get a URL like https://abc123.ngrok-free.app. Copy it.
Get a stable URL (recommended) Free ngrok accounts get a random URL on every restart — meaning 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

Register in GitHub:
  1. Go to your repo → Settings → Webhooks → Add webhook
  2. Set Payload URL: https://your-ngrok-url.ngrok-free.app/api/webhook
  3. Set Content type: application/json
  4. Add a Secret — save it
  5. Choose events (or “Send me everything”)
  6. Click Add webhook
Store the secret:
React to events:
corsair.ts

How it works

Every plugin shares the same endpoint. You never write routing logic.

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.