Skip to content

cloudflare

CloudflareCarrierStorage = WatchdogSqliteOwner & Pick<DurableObjectStorage, "transaction" | "getAlarm" | "setAlarm" | "deleteAlarm">>

Native SQLite and alarms; the Cloudflare adapter owns their atomic composition.


CloudflareCarrierOptions = Readonly<{ storage: CloudflareCarrierStorage; canSend?: (emailId) => Promise<boolean>>; }> & Readonly<{ email: SendEmail; transport?: never; }> | Readonly<{ transport: Options["transport"]; email?: never; }>

Native storage/wake composition with exactly one provider capability.


CloudflareCarrier = Pick<Carrier, "send" | "get"> > & Readonly<{ alarm: () => Promise<void>>; }>

Ordinary submission operations and the native Durable Object alarm door.

createCloudflareCarrier(options): Promise<CloudflareCarrier>>

Construct one owner per Durable Object. Forward its native alarm to alarm. Acceptance commits the Email, recipient Messages, Watchdog job and wake together.

CloudflareCarrierOptions

Promise<CloudflareCarrier>


cloudflareEmailTransport(binding): (email) => Promise<SendEvidence>>

The native binding as a Carrier transport. Exported so a host that holds the binding elsewhere (the Hub’s Cloudflare edge) classifies sends identically.

SendEmail

(email) => Promise<SendEvidence>