# Brevo (/docs/v/0.6.1/adapters/brevo)



The Brevo adapter calls the [Brevo transactional email API](https://developers.brevo.com/reference/sendtransacemail) over `fetch` — no extra dependency. It authenticates with Brevo's `api-key` header (not a Bearer token), supports every common field, and maps `metadata` to Brevo's `params` — the same values Brevo templates substitute.

<ProviderBadge adapter="brevo" />

## Configure [#configure]

Create an API key under [SMTP & API in the Brevo dashboard](https://app.brevo.com/settings/keys/api) and verify the sender or domain you use in `from`.

```ts title="lib/email.ts"
import { createEmailClient } from "@opencoredev/email-sdk";
import { brevo } from "@opencoredev/email-sdk/brevo";

export const email = createEmailClient({
  adapters: [brevo({ apiKey: process.env.BREVO_API_KEY! })],
});
```

<TypeTable
  type="{
  apiKey: {
    description: &#x22;Brevo API key, sent as the api-key request header.&#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.brevo.com&#x22;',
  },
  fetch: {
    description: &#x22;Custom fetch implementation for tests or special runtimes.&#x22;,
    type: &#x22;typeof fetch&#x22;,
  },
}"
/>

## Send [#send]

Brevo maps `cc`, `bcc`, `headers`, `attachments`, `tags` (values only), and `metadata` (as `params`). `replyTo` accepts a single address — two or more throw an `EmailValidationError` before any request.

```ts
const result = await email.send({
  from: "Acme <hello@acme.com>",
  to: [{ email: "user@example.com", name: "Ada" }],
  replyTo: "support@acme.com",
  subject: "You're invited to the Acme workspace",
  html: "<p>Ada invited you to join the Acme workspace.</p>",
  metadata: { workspaceId: "ws_123" },
  tags: [{ name: "type", value: "invite" }],
});

console.log(result.id); // Brevo messageId, also exposed as result.messageId
```

The response `id` is Brevo's `messageId` (falling back to `id`) — match it against events in Brevo's logs and webhooks.

<Callout type="warn" title="Metadata becomes template params">
  `metadata` is sent as Brevo `params`, the values Brevo substitutes into templates. If you use
  Brevo template syntax in your content, pick metadata keys that don't collide with template
  placeholders.
</Callout>

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

```bash
BREVO_API_KEY="xkeysib-..." npx email-sdk doctor --adapter brevo
```

```bash
BREVO_API_KEY="xkeysib-..." npx email-sdk send \
  --adapter brevo \
  --from "Acme <hello@acme.com>" \
  --to user@example.com \
  --subject "Brevo smoke test" \
  --text "It works" \
  --dry-run
```

Drop `--dry-run` for one real send — that is the only check that proves the key, sender verification, and recipient policy are ready.
