Self-hosted · CFFlowmails
Runtime v0.1
React Router 7
Node.js — server actions / loaders
Flowmails + React Router 7
The framework Flowmails itself ships on. Call Flowmails from any server loader or action — the SDK is just a thin wrapper over the REST API.
Step 1
Install the SDK
installbash
pnpm add @flowmails/flowmails-sdkStep 2
Send your first message
sendtypescript
// app/routes/contact.tsx (action)
import { Flowmails } from "@flowmails/flowmails-sdk";
import type { Route } from "./+types/contact";
export async function action({ request }: Route.ActionArgs) {
const form = await request.formData();
const fm = new Flowmails({ apiKey: process.env.FLOWMAILS_API_KEY! });
const result = await fm.send({
from: "hello@yourdomain.com",
to: String(form.get("email")),
subject: "Welcome",
text: `Hi ${form.get("name")}, thanks for signing up.`,
});
return { ok: true, id: result.id };
}Prerequisites
What you need first
- React Router 7 in framework mode (loaders + actions)
- FLOWMAILS_API_KEY in your environment
Runtime notes
Things to know on React Router 7
Loader-only flows (no UI form) can call Flowmails directly in the loader — no action required.
If you're on Cloudflare with Workers (RR7 SSR), the SDK runs in the same V8 isolate.
Other integrations