@rewritetoday/express is the Rewrite adapter for Express applications that need a framework-native webhook endpoint with minimal setup.
Repository: github.com/RewriteToday/adapters
When to use it
- Your application already uses Express routing and middleware.
- You want the adapter to handle the raw-body middleware required for webhook verification.
- You prefer named event callbacks instead of manual request parsing.
- You need a dedicated, verified ingress route for Rewrite webhooks.
Key capabilities
Express-native middleware
Mount the webhook handler directly in
app.post(...) with the middleware shape Express expects.Raw body handling
The adapter already manages the raw request body needed for signature verification.
Typed callbacks
Handle supported Rewrite events with named hooks or use
onPayload for generic routing.Verified before business logic
Signature validation runs before your application code sees the payload.
Install
Basic example
Best practices
Use a dedicated webhook route
Use a dedicated webhook route
Keep the Rewrite webhook endpoint isolated from generic JSON middleware so raw-body handling stays predictable.
Return a 2xx quickly
Return a 2xx quickly
Acknowledge delivery as soon as possible and push long-running work into a queue, job runner, or background processor.
Deduplicate by event id
Deduplicate by event id
Store the webhook event id and make side effects idempotent so retry deliveries stay safe.
Available event callbacks
Available event callbacks
The adapter supports
onSMSOTP, onMessageSent, onMessageBatch, onMessageQueued, onMessageDelivered, onMessageScheduled, onMessageFailed, onMessageCanceled, and the generic onPayload hook.Related docs
Adapters overview
Compare the official adapters and choose the right integration surface.
Webhook overview
Delivery format, signature validation, retries, and operational guidance.
Webhook event types
Payload guides for every supported Rewrite webhook event.