Flaresend
MIT100% open source

Transactional email that runs in your Cloudflare account.

Flaresend is an open-source email API you deploy to Cloudflare. Send over REST from any app, or over RPC from your Workers, with logs, retries, templates and webhooks built in. Nothing sits between your code and Cloudflare.

$ npm install @flaresend/client
import { Flaresend } from '@flaresend/client';

const flaresend = new Flaresend({
  apiKey: process.env.FLARESEND_API_KEY!,
  baseUrl: 'https://mailer.acme.com',
});

const { id } = await flaresend.emails.send({
  from: 'Acme <hello@acme.com>',
  to: 'ada@example.com',
  subject: 'Welcome to Acme',
  template: 'welcome',
  data: { name: 'Ada', appName: 'Acme', loginUrl },
});

Built entirely on Cloudflare

  • Workers
  • D1
  • R2
  • Queues
  • Email Service
  • Hono
  • React Email

Why Flaresend

An email service you own, not one you rent

Hosted email APIs are easy to start with. Flaresend keeps that ease and moves the whole thing into your own infrastructure.

Runs in your account

The mailer is one Worker you deploy. The email log lives in your D1 database and email bodies in your R2 bucket. No other company sees your mail or your users.

An API you already know

Modeled on Resend: POST /v1/emails, idempotency keys, batch and scheduled sends, typed errors and a typed SDK for Node.js, Bun and Workers.

Open source, MIT

Every line is on GitHub. Read it, change it, fork it, run it for as long as you like. No license keys, no seat limits, no paid tier.

How it works

Accepted in milliseconds, sent from a queue

Your request returns as soon as the email is safely stored. Sending, retrying and tracking happen in the background.

  1. 01

    Your app sends

    POST /v1/emails with an API key from anywhere, or MailerRpc.send() from another Worker.

  2. 02

    Flaresend accepts it

    Checks the sender, suppressions, size and rate limits. Logs it in D1, stores the body in R2, puts it on a queue and answers 202.

  3. 03

    The queue sends it

    A consumer hands it to Cloudflare Email Service. Temporary errors are retried up to 8 times with backoff.

  4. 04

    Events come back

    Delivered, bounced and complained events update the log, suppress bad addresses and fire your webhooks.

Every email and event logged in D1
Bodies kept in R2 for 30 days, for viewing and resending
Webhooks signed with HMAC-SHA256

Features

Everything a transactional email service should do

The parts you would otherwise build yourself around a raw send call.

Dashboard

See every email you send

Open any email to see its full timeline, from queued to delivered, and the exact HTML that went out. Manage keys, domains, templates and webhooks in the same place.

Self-host

From an empty account to your first email

Everything runs on Wrangler. Create the database, bucket and queues, onboard your domain, and deploy.

  • No servers, containers or databases to look after
  • CI workflow included: migrate and deploy on every push to main
  • The dashboard can onboard new domains for you
terminal
git clone https://github.com/flaresend-dev/flaresend && cd flaresend
pnpm install && pnpm build && cd apps/mailer

npx wrangler d1 create flaresend
npx wrangler r2 bucket create flaresend-payloads
npx wrangler queues create flaresend-send  # + 3 more
npx wrangler email sending enable acme.com
npx wrangler secret put ADMIN_API_KEY

npx wrangler d1 migrations apply flaresend --remote
npx wrangler deploy

Open source

All of it. Not an open core.

The mailer, the dashboard, the SDK, the templates, the CLI and these docs are in one repository under the MIT license. There is no hosted edition with extra features. What you see on GitHub is the whole product.

flaresend-dev/flaresend
  • apps/mailerThe Worker: HTTP API, RPC entrypoints, queue consumers, cron
  • apps/dashboardNext.js dashboard, deployed to Workers
  • apps/docsThe documentation site
  • packages/client@flaresend/client on npm: HTTP, RPC, webhook checks
  • packages/templatesReact Email templates rendered in the mailer
  • packages/cliThe flaresend command for the admin API

FAQ

Questions

What does it cost?+

Flaresend itself is free and MIT licensed. It runs on your Cloudflare account, so you pay Cloudflare for the Workers, D1, R2, Queues and Email Service it uses, at their prices. There is no Flaresend plan or bill.

How is this different from Resend?+

If you have used Resend, the requests and responses will look familiar. The difference is where it runs: Flaresend is code you deploy to your own Cloudflare account. Your email log, your email bodies and your limits stay under your control.

Can I send newsletters or marketing email?+

No. Cloudflare Email Service is for transactional email, and its terms do not allow marketing or bulk campaigns. Broadcasts exist for small, opted-in lists: they are off per project by default and capped at 500 recipients unless you change the limit.

Do my domains have to be on Cloudflare?+

Cloudflare’s docs say Email Service needs the domain’s DNS on Cloudflare. On those zones Flaresend adds the SPF and DKIM records for you.

Can other Workers send without an API key?+

Yes. Add a service binding to the mailer Worker and call it over RPC. Only Workers in the same Cloudflare account can bind to it.

Send your first email from your own account

Deploy the mailer, create a key, and send. The quickstart takes you through it.