Prerequisites
Before you begin, make sure you have:API Key
Create an API key in the Lettr dashboard
Verified Domain
Add and verify your sending domain
- Cloudflare account (free tier works)
- Wrangler CLI installed (
npm install -g wrangler) - Node.js 18.x or 20.x for local development
Quick Setup
1
Create a new Worker project
- Type: “Hello World” Worker
- TypeScript: Yes (recommended)
- Git: Yes (optional)
- Deploy: No (we’ll deploy later)
2
Install the Lettr SDK
3
Add your API key as a secret
lttr_).4
Deploy your Worker
https://my-email-worker.your-subdomain.workers.dev.Worker Implementation
Create or updatesrc/index.ts:
Cloudflare Workers use the
Env interface to define environment variables and secrets. The Lettr SDK automatically handles retries and provides detailed error messages.Configuration
Configure your Worker inwrangler.toml:
What’s Next
Advanced Guide
Learn about deployment, monitoring, and advanced patterns
AWS Lambda
Deploy on AWS Lambda
Vercel Functions
Deploy on Vercel
API Reference
Complete API documentation