One typed send call.
Email, built for engineers.
One typed, idempotent send call with signed webhooks, versioned templates, and a typed verifier in the SDK. Install samva and the first email goes out in minutes.
// 1 · install the typed SDK
// npm install samva
import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY });
// 2 · send your first email
const { id } = await samva.messages.send({
channel: "email",
to: [{ email: "maya@acme.com" }],
email: {
subject: "Your order shipped",
templateId: "order-update",
},
});From API key to first send in one typed call.
Install samva, pass your key, and call samva.messages.send. Request and response are typed end to end, so the compiler catches a bad payload before production does.
- Typed request and response, so the compiler catches a bad payload, not a 422 in production
- Server-rendered templates addressed by name. Pass data, the rendered message goes out
- Runs from Node, edge runtimes, and serverless. One SDK, every JS target
// 1 · install the typed SDK
// npm install samva
import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY });
// 2 · send your first email
const { id } = await samva.messages.send({
channel: "email",
to: [{ email: "maya@acme.com" }],
email: {
subject: "Your order shipped",
templateId: "order-update",
},
});TypeScript SDK or raw HTTP. Your pick.
The TypeScript SDK is the fast path. Prefer raw HTTP? The same contract ships an OpenAPI 3 spec, so a generated client in any language calls the identical send.
samva
End-to-end types for every request, response, and event, with idempotency and a typed webhook verifier built in. The same import runs in Node, on the edge, and in serverless.
$ npm install samvaapi.samva.app
Predictable resources, standard HTTP verbs, cursor pagination, and an OpenAPI 3 spec you generate clients from. The same send call the SDK uses, callable from any language.
POST /v1/messages
GET /v1/messages/:idEvery state change arrives as a signed event you verify in code.
Your system stays in sync without polling. Delivered, bounced, and complained events each arrive as an HMAC-signed, replay-protected webhook. Verify it with one SDK call, switch on the type, and handle it. Retried with backoff until your endpoint acknowledges.
// verify the signature, then handle the event
const event = samva.webhooks.verify(req.body, sig);
switch (event.type) {
case "email.delivered":
case "email.bounced":
case "email.complained":
recordStatus(event.data);
}Safe to retry. The same key returns the same send.
Retry without double-sending
A flaky network or queue redelivery never becomes a duplicate-email incident. Pass an idempotency key and a retried request returns the original send. Same message id, never a second email.
Transient failures handled on our side
One call is enough, so you never wire up a retry queue. We retry carrier timeouts and throttling with backoff on our side, and every attempt shows up in the same events.
Events you can verify came from Samva
Confirm a payload is real in one call, no hand-rolled signature check. Every webhook is HMAC-signed with replay protection, and a typed verifier ships in samva.
// same key → same send, even on retry
await samva.messages.send(
{ channel: "email", to, email },
{ idempotencyKey: "order-9f3a-shipped" },
);Two send calls sharing one idempotency key resolve to the same message id. One email, not two.
Email you reason about in code.
Every send is tracked in code your system owns end to end: typed clients, signed events, idempotent sends. You integrate the SDK; we run the mail stack behind it.
- Idempotent sends with automatic backoff retries
- HMAC-signed webhooks with a typed verifier in the SDK
- OpenAPI 3 spec and generated clients in any language
// 1 · install the typed SDK
// npm install samva
import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY });
// 2 · send your first email
const { id } = await samva.messages.send({
channel: "email",
to: [{ email: "maya@acme.com" }],
email: {
subject: "Your order shipped",
templateId: "order-update",
},
});Send your first email today.
Request early access, drop in the SDK, and send on your own domains. The first email goes out in minutes.