Cloudflare Workers
Cloudflare Workers (V8 isolates)

Flowmails + Cloudflare Workers

The home-runtime for Flowmails — the receive Worker, the dashboard, and the outbound send all run on Workers. The SDK works the same shape it does anywhere else.

Step 1

Install the SDK

installbash
pnpm add @flowmails/flowmails-sdk

Step 2

Send your first message

sendtypescript
// src/send.ts (Worker)
import { Flowmails } from "@flowmails/flowmails-sdk";

export interface Env {
  FLOWMAILS_API_KEY: string;
}

export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const fm = new Flowmails({ apiKey: env.FLOWMAILS_API_KEY });
    const result = await fm.send({
      from: "hello@yourdomain.com",
      to: "user@example.com",
      subject: "Welcome",
      text: "Thanks for signing up.",
    });
    return Response.json(result);
  },
};

Prerequisites

What you need first

  • Cloudflare account with Workers enabled
  • Flowmails API key from the dashboard

Runtime notes

Things to know on Cloudflare Workers

The SDK is tree-shakeable — only `Flowmails` and the type guards ship in the bundle.

If you want the SDK to never touch the network, pass `fetch` overrides in the constructor options.

Other integrations

All Flowmails integrations