# Scaleway (/docs/v/0.6.1/adapters/scaleway)



The Scaleway adapter calls the [Scaleway Transactional Email API](https://www.scaleway.com/en/developers/api/transactional-email/) over `fetch` — no extra dependency. Sends are region-scoped: the adapter targets `/regions/{region}/emails` and defaults to `fr-par`.

<ProviderBadge adapter="scaleway" />

## Configure [#configure]

Create an IAM secret key in the Scaleway console, note your project ID, and verify the sending domain in Transactional Email.

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

export const email = createEmailClient({
  adapters: [
    scaleway({
      secretKey: process.env.SCALEWAY_SECRET_KEY!,
      projectId: process.env.SCALEWAY_PROJECT_ID!,
    }),
  ],
});
```

<TypeTable
  type="{
  secretKey: {
    description: &#x22;Scaleway IAM secret key, sent as the X-Auth-Token header.&#x22;,
    type: &#x22;string&#x22;,
    required: true,
  },
  projectId: {
    description: &#x22;Scaleway project ID the emails belong to.&#x22;,
    type: &#x22;string&#x22;,
    required: true,
  },
  region: {
    description: &#x22;Transactional Email region used in the endpoint path.&#x22;,
    type: &#x22;string&#x22;,
    default: '&#x22;fr-par&#x22;',
  },
  baseUrl: {
    description: &#x22;Override the API origin, e.g. for a proxy.&#x22;,
    type: &#x22;string&#x22;,
    default: '&#x22;https://api.scaleway.com&#x22;',
  },
  fetch: {
    description: &#x22;Custom fetch implementation for tests or special runtimes.&#x22;,
    type: &#x22;typeof fetch&#x22;,
  },
}"
/>

## Send [#send]

Scaleway maps `cc`, `bcc`, `replyTo`, `headers`, and `attachments`.

```ts
const result = await email.send({
  from: "Acme <billing@acme.com>",
  to: "user@example.com",
  replyTo: "support@acme.com",
  subject: "Your May invoice",
  html: "<p>Invoice INV-2041 is attached.</p>",
  attachments: [
    { filename: "invoice.txt", content: "Invoice INV-2041 — 49.00 EUR", contentType: "text/plain" },
  ],
});

console.log(result.id); // Scaleway email id (`id` or `email_id` in the response)
```

`replyTo` travels as a `Reply-To` entry in Scaleway's `additional_headers`. Setting both `replyTo` and a manual `Reply-To` header throws an `EmailValidationError` before any request — pick one.

<Callout type="warn" title="No tags or metadata">
  Scaleway has no tag or metadata concept, so either field throws an `EmailValidationError` before
  any request is made. Pick a [tag-capable adapter](/docs/v/0.6.1/adapters/field-support) if you need them.
</Callout>

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

```bash
SCALEWAY_SECRET_KEY="..." SCALEWAY_PROJECT_ID="..." npx email-sdk doctor --adapter scaleway
```

```bash
SCALEWAY_SECRET_KEY="..." SCALEWAY_PROJECT_ID="..." npx email-sdk send \
  --adapter scaleway \
  --region fr-par \
  --from "Acme <hello@acme.com>" \
  --to user@example.com \
  --subject "Scaleway smoke test" \
  --text "It works" \
  --dry-run
```

`--region` falls back to the `SCALEWAY_REGION` env var, then `fr-par`. Drop `--dry-run` for one real send to prove the key, project, region, and sender domain line up.
