Boundry with Cloudflare Workers
The SDK uses web-standard fetch and has no Node runtime dependency. Bind BOUNDRY_API_KEY as a Worker secret. This walkthrough covers installation, a server-side sending helper, and the production checks that matter for Cloudflare Workers.
Install
This guide uses the published boundry-sdk package. Its generated source is public on GitHub.
Shell
npm install boundry-sdkAdd the server-side helper
In the Boundry dashboard, select the project you are integrating, then create a project API key. Store BOUNDRY_API_KEY in the framework’s secret or server environment. Never include a project key in browser code.
typescript
import Boundry from 'boundry-sdk';
interface Env { BOUNDRY_API_KEY: string }
export default {
async fetch(_request: Request, env: Env): Promise<Response> {
const client = new Boundry({ apiKey: env.BOUNDRY_API_KEY });
const email = await client.emails.send({
from: 'Acme <hello@acme.com>',
to: 'ava@example.com',
subject: 'Welcome to Acme',
html: '<p>It works.</p>',
});
return Response.json({ id: email.id });
},
};Production checklist
- Send only from a domain verified in this regional project.
- Move user-facing sends to the framework’s job system when available.
- Reuse an idempotency key if you retry after an uncertain response.