Webhook Router
Infrastructure

Webhook Router

Handle provider webhook events

The webhook router is not yet implemented. The types and handler factories exist in @betternotify/core but throw NotifyRpcNotImplementedError at runtime. This feature ships in a future release.

Planned design

The webhook router will handle inbound webhook events from email providers (SES, Resend, SendGrid) with provider-specific signature verification and typed event routing.

  • WebhookRouter defined via rpc.webhookRouter({...}) — maps provider event types to typed handlers.
  • WebhookAdapter per provider — parses raw payloads, verifies signatures, and normalizes events into a common shape.
  • toNodeHandler and toFetchHandler — convert the router into an HTTP handler for Node.js or Fetch-based runtimes (Cloudflare Workers, Deno, Bun).
  • Event correlation — webhook events are matched to sends via the dot-path route ID used as the correlation key.

Provider adapters (e.g. @betternotify/resend) will each export a WebhookAdapter for signature verification. SES webhook support (SNS-based) will be built into core.

On this page