How it works
Every webhook event in Corsair supports anafter hook — a function that runs after the event is saved to your database. Inside it, you have full access to corsair and can call any plugin API.
corsair.ts
Common patterns
- GitHub → Slack
- Slack → GitHub
- Multi-step
Notify Slack when a PR is merged:Alert on new stars:
corsair.ts
corsair.ts
Filter with before hooks
Use before to reject events before they hit your database or after handler:
corsair.ts
before stops processing entirely — the event isn’t saved to your database.
Background jobs
For heavy processing (LLM calls, sending emails, generating reports), fire a background job instead of doing work inline:corsair.ts
inngest/functions.ts
What’s next
Webhooks Setup
Get ngrok running and register your first webhook endpoint.
GitHub Webhooks
All available GitHub events you can react to.
Slack Webhooks
All available Slack events you can react to.
Hooks Reference
Full before/after hook API and all available options.