Unosend
Send through the Unosend REST API, a single Bearer-authenticated endpoint with CC, BCC, tags, and attachments.
Capabilities
| Repeated headers | Idempotency | Scheduling | Personalized |
|---|---|---|---|
| No | none |
No | expanded |
These values come from the adapter’s exported capabilities declaration. The field support matrix covers normalized message fields.
The Unosend adapter calls the Unosend REST API with plain fetch. It is one of the simplest providers to wire up: one Bearer-authenticated /emails endpoint, one API key, no other configuration.
Configure
Create a server-side API key in your Unosend account and verify the domain you send from.
import { createEmailClient } from "@opencoredev/email-sdk";
import { unosend } from "@opencoredev/email-sdk/unosend";
export const email = createEmailClient({
adapters: [unosend({ apiKey: process.env.UNOSEND_API_KEY! })],
});
apiKeystring
Unosend API key.
stringbaseUrl?string
Override the API origin, e.g. for a proxy.
string"https://api.unosend.co"fetch?typeof fetch
Custom fetch implementation for tests or special runtimes.
typeof fetchSend
Unosend maps cc, bcc, headers, tags, attachments, and a single replyTo address.
const result = await email.send({
from: "Acme <hello@acme.com>",
to: [{ email: "user@example.com", name: "Ada" }],
replyTo: "support@example.com",
subject: "You're invited to the Acme workspace",
html: "<p>Grace invited you to join the Acme workspace.</p>",
tags: [{ name: "type", value: "invite" }],
});
console.log(result.id); // Unosend email id
The adapter checks success in the response body and throws an EmailAdapterError when Unosend reports a failure, even on an HTTP 200.
Verify from the CLI
UNOSEND_API_KEY="un_..." npx --package @opencoredev/email-sdk email-sdk doctor --adapter unosend
UNOSEND_API_KEY="un_..." npx --package @opencoredev/email-sdk email-sdk send \
--adapter unosend \
--from "Acme <hello@acme.com>" \
--to user@example.com \
--subject "Unosend smoke test" \
--text "It works" \
--dry-run
Drop --dry-run to send for real. Unosend has no extra credentials to get wrong, so a live send that prints an id means the key and the verified domain were the whole story. If it fails, the CLI surfaces Unosend’s own error message from the response body.
Frequently asked questions
Does Email SDK support Unosend?
Yes. Email SDK ships a Unosend adapter imported from @opencoredev/email-sdk/unosend. You keep your Unosend account and credentials; the SDK adds message validation, typed errors, and no-network test adapters around the same send() call used for every other provider.
Which message fields does the Unosend adapter support?
Unosend supports CC recipients, BCC recipients, Reply-To address, Custom headers, Attachments, and Tags. It does not support Metadata and Scheduled sending (sendAt); Email SDK rejects a message that uses those fields before any request is made.
Can Unosend schedule email for later with Email SDK?
No. Unosend has no provider-side scheduling, so a message with sendAt fails validation. Store the job in your own queue and send when it is due.
Does the Unosend adapter support idempotent sends?
No. Unosend has no provider-side idempotency, so a retried send can be delivered twice. A send with idempotencyKey on a route that includes Unosend fails with EmailValidationError unless you pass idempotency: “best-effort”. Deduplicate in your own queue before retrying.