Skip to main content
Serverless is one of the fastest ways to integrate Rewrite in production. Use the official SDK to send SMS from platforms like Vercel Functions, Cloudflare Workers, and Supabase Edge Functions without managing servers.

Why serverless?

Fast deployment

Deploy globally in minutes with minimal infra setup.

Pay per execution

Only pay for requests you actually process.

Edge proximity

Reduce latency by running close to your users.

Simple scaling

Handle traffic spikes without manual autoscaling work.

Supported guides

Vercel Functions

Build a POST endpoint and send SMS with @rewritetoday/sdk.

Cloudflare Workers

Send SMS from an edge worker using @rewritetoday/sdk.

Supabase Edge Functions

Send SMS from a Supabase edge function with @rewritetoday/sdk.

Common pattern

All serverless runtimes follow the same flow:
  1. Read secrets from env bindings
  2. Instantiate Rewrite
  3. Validate request payload
  4. Call rewrite.messages.send(...)
  5. Return JSON response with proper status code
Keep your API key server-side only. Never expose REWRITE_API_KEY in client bundles.