FlaresendDocs

Introduction

Flaresend is a transactional email API that runs in your own Cloudflare account.

Flaresend gives your apps a Resend-style email API on top of Cloudflare Email Service. You deploy one Worker, and every app you run sends through it: other Workers call it over a service binding, and everything else calls a REST API with a project key.

Every send is logged, retried on failure, tracked through delivery, and reported back to you with signed webhooks. Nothing leaves your Cloudflare account.

Send in one call

import { Flaresend } from '@flaresend/client';

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

await flaresend.emails.send({
  from: 'Acme <hello@acme.com>',
  to: 'ada@example.com',
  subject: 'Hello from Flaresend',
  html: '<p>It works.</p>',
});

https://mailer.example.com stands for the URL of your own mailer Worker. Flaresend is not a hosted service: you deploy it once, then point every app at it.

What you get

How it fits together

Sending
Your app
HTTP with an API key, or RPC from a Worker in the same account
Flaresend Worker
Validates, logs to D1, stores the body in R2, answers 202 queued
Send queue
Retries with backoff, up to 8 times
Email Service
Cloudflare delivers the message
After sending
Delivery events
One event per recipient: delivered, bounced, complained…
Events queue
Deduped, never downgrades a final status
Status + suppressions
Email status updated, hard bounces and complaints suppressed
Your webhooks
Signed POST for every event you subscribe to

Read How it works for the details of each step.

Transactional email only

Cloudflare Email Service is for transactional email. Marketing and bulk campaigns are not permitted. Flaresend's broadcasts are off by default and capped at 500 recipients, for small lists of people who opted in.

On this page