# Unosend (/docs/v/0.6.1/adapters/unosend)



The Unosend adapter calls the Unosend REST API over `fetch` — no extra dependency. It is one of the simplest providers to wire up: one Bearer-authenticated `/emails` endpoint, one API key, no other configuration.

<ProviderBadge adapter="unosend" />

## Configure [#configure]

Create a server-side API key in your Unosend account and verify the domain you send from.

```ts title="lib/email.ts"
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! })],
});
```

<TypeTable
  type="{
  apiKey: {
    description: &#x22;Unosend API key.&#x22;,
    type: &#x22;string&#x22;,
    required: true,
  },
  baseUrl: {
    description: &#x22;Override the API origin, e.g. for a proxy.&#x22;,
    type: &#x22;string&#x22;,
    default: '&#x22;https://api.unosend.co&#x22;',
  },
  fetch: {
    description: &#x22;Custom fetch implementation for tests or special runtimes.&#x22;,
    type: &#x22;typeof fetch&#x22;,
  },
}"
/>

## Send [#send]

Unosend maps `cc`, `bcc`, `headers`, `tags`, `attachments`, and a single `replyTo` address.

```ts
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, also exposed as result.messageId
```

The adapter checks `success` in the response body and throws an `EmailProviderError` when Unosend reports a failure, even on an HTTP 200.

<Callout type="warn" title="No metadata, one reply-to">
  Unosend has no metadata field and accepts only one `replyTo` address. A message with `metadata`
  or multiple reply-to addresses throws an `EmailValidationError` before any request is made — use
  `tags`, or pick a [metadata-capable adapter](/docs/v/0.6.1/adapters/field-support).
</Callout>

## Verify from the CLI [#verify-from-the-cli]

```bash
UNOSEND_API_KEY="un_..." npx email-sdk doctor --adapter unosend
```

```bash
UNOSEND_API_KEY="un_..." npx 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` for one real send — that is the only check that proves the API key and sending domain are ready.
