Why adapters?
Framework-native
Mount webhook handlers directly in Express, Fastify, Elysia, Hono, or standard edge runtimes.
Secure by default
Signature verification happens before the payload reaches your business logic.
Typed events
Handle
sms.otp and message lifecycle events with named callbacks or a generic payload hook.Less boilerplate
Skip raw-body parsing, route glue, and repetitive webhook validation code.
Adapter catalog
Edge
Standard
Request and Response handling for workers and edge-native runtimes.Elysia
Native webhook routes for Elysia applications with minimal setup.
Express
Express middleware wiring with the raw-body handling required for signature validation.
Fastify
Plugin-based registration for Fastify services that want a clean webhook boundary.
Hono
Lightweight webhook handlers for Hono apps running on edge or Node-compatible runtimes.
Adapter, SDK, or package?
I need to receive Rewrite webhooks in my framework
I need to receive Rewrite webhooks in my framework
Start with the adapter that matches your HTTP stack. It gives you the smallest integration surface and the least webhook-specific boilerplate.
I need to send API requests, not receive webhooks
I need to send API requests, not receive webhooks
Use an official SDK or
@rewritetoday/rest instead. Adapters focus on inbound webhook verification and event dispatch.I already have my own HTTP layer
I already have my own HTTP layer
Use the base ecosystem packages directly when you only need contracts, validation, or transport primitives and prefer to build the route integration yourself.
Common flow
- Install the adapter that matches your framework or runtime.
- Read the webhook secret from environment variables or platform bindings.
- Register a
POSThandler for your Rewrite webhook endpoint. - Handle specific events with named callbacks or use
onPayloadfor generic routing. - Return
2xxquickly and offload long-running work to a queue or background task.
Available callbacks
All official adapters expose the same event callback surface:onSMSOTPonMessageSentonMessageBatchonMessageQueuedonMessageDeliveredonMessageScheduledonMessageFailedonMessageCanceledonPayload
Adapters are for webhook consumers. Keep
REWRITE_API_KEY out of your webhook endpoint and store only the webhook signing secret there.Related docs
Webhook overview
Delivery format, signature validation, retries, and webhook registration basics.
Webhook event types
Payload families and event-specific pages for
sms.otp and message lifecycle events.Adapters repository
Package source code, examples, and release history for every official adapter.