@rewritetoday/hono is the Rewrite adapter for Hono applications running on edge or Node-compatible runtimes.
Repository: github.com/RewriteToday/adapters
When to use it
- Your application already exposes HTTP routes through Hono.
- You want a lightweight webhook handler that fits Hono’s request model.
- You prefer typed event callbacks instead of manual signature verification code.
- You need one webhook integration that can move between edge and server runtimes with minimal changes.
Key capabilities
Hono-native route
Register the Rewrite webhook endpoint with the same
app.post(...) style you already use in Hono.Signature verification
Invalid webhook signatures are rejected before your callback runs.
Typed callbacks
Use named handlers for specific Rewrite events or
onPayload for generic processing.Cross-runtime friendly
The same integration style works well across edge and Node-compatible Hono deployments.
Install
Basic example
Best practices
Keep secrets in runtime config
Keep secrets in runtime config
Load the webhook signing secret from environment variables or bindings rather than hardcoding it in your app.
Respond quickly to deliveries
Respond quickly to deliveries
Keep the route focused on verification and dispatch. Push longer work into queues or background tasks.
Deduplicate retry deliveries
Deduplicate retry deliveries
Rewrite can retry webhook deliveries, so persist the event id and make side effects idempotent.
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 all official adapters and understand where each one fits.
Webhook overview
Delivery format, retries, signature validation, and operational guidance.
Webhook event types
Event-specific payload pages for supported Rewrite webhook families.