Skip to main content
@rewritetoday/elysia is the Rewrite adapter for Elysia applications that want a native webhook route with minimal ceremony. Repository: github.com/RewriteToday/adapters

When to use it

  • Your backend already uses Elysia routing and handler patterns.
  • You want a framework-first adapter instead of wiring request verification manually.
  • You prefer typed event callbacks over custom webhook parsing code.
  • You want a clean route-level boundary for inbound Rewrite events.

Key capabilities

Elysia-native route

Register a webhook endpoint with the same app.post(...) style you already use in Elysia.

Verified before dispatch

Signature validation runs before the payload reaches your business logic.

Typed event hooks

Handle specific webhook families with named callbacks or process everything through onPayload.

No extra glue

The package is ready to use with Elysia without extra webhook-specific dependencies.

Install

Basic example

Best practices

Load the signing secret from environment variables and keep it separate from any client-exposed configuration.
Keep business logic outside the route callback when possible so verification, logging, and downstream processing stay easy to reason about.
Rewrite webhooks can be retried. Store the event id and make side effects idempotent.
The adapter supports onSMSOTP, onMessageSent, onMessageBatch, onMessageQueued, onMessageDelivered, onMessageScheduled, onMessageFailed, onMessageCanceled, and the generic onPayload hook.

Adapters overview

Compare the official adapters and choose the right integration point for your stack.

Webhook overview

Delivery format, signature validation, retry semantics, and registration guidance.

Webhook event types

Payload guides for sms.otp and message lifecycle events.