Skip to content
You're viewing documentation for v0.6.4. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Primitive

Send through Primitive's email API for AI agents over fetch — base64 attachments and idempotent retries, with fail-fast validation for fields it cannot represent.

The Primitive adapter calls Primitive’s POST /v1/send-mail endpoint over fetch — no extra dependency. Primitive is email infrastructure for AI agents: a REST API for sending and receiving mail, with idempotency, typed errors, and an async delivery model. The adapter maps the normalized EmailMessage straight onto its send payload.

Primitive logo
PrimitiveLive check available@opencoredev/email-sdk/primitive
Provider docs

Configure

Create a Primitive API key (prefixed prim_) and verify the outbound domain you send from.

PropType
apiKeystring

Primitive API key (prefixed prim_) or OAuth access token (prefixed prim_oat_).

Typestring
baseUrl?string

Override the API origin, e.g. for a proxy.

Typestring
Default"https://api.primitive.dev/v1"
fetch?typeof fetch

Custom fetch implementation for tests or special runtimes.

Typetypeof fetch
headers?Record<string, string>

Extra headers merged into every request.

TypeRecord<string, string>

Send

Primitive’s send API targets a single recipient and accepts html, text, and attachments. Attachments are base64-encoded automatically.

Idempotent sends

Pass an idempotencyKey and the adapter forwards it as Primitive’s Idempotency-Key header, so a retried send with the same key and body replays the original result instead of sending twice.

Verify from the CLI

Drop --dry-run for one real smoke send — the only check that proves the API key and sender domain are ready.

Last updated on