---
title: "SDK"
description: "A typed TypeScript client for the OpenEmail API. Zero dependencies, and one method for every endpoint."
url: "https://openemail.uk/docs/sdk"
area: "SDK"
category: "Getting started"
---

# SDK

A typed TypeScript client for the OpenEmail API. Zero dependencies, and one method for every endpoint.

## What it is

One package over the whole API (sending, templates, tracking, threads, drafts, labels, contacts, audiences, domains, rules, webhooks, calendar, settings, roles, members and disposable inboxes) with types for every request and response, two error classes, retries that cannot duplicate a send, and a webhook signature verifier. No runtime dependencies, ESM and CommonJS, on Node 20+, Bun, Deno and Cloudflare Workers. It carries a workspace key, so it runs on a server, and disposable inboxes are the one part that also runs in a browser.

**Install**

_pnpm_

```text
pnpm add @openemail/sdk
```

_npm_

```text
npm install @openemail/sdk
```

_yarn_

```text
yarn add @openemail/sdk
```

_bun_

```text
bun add @openemail/sdk
```

_deno_

```text
deno add npm:@openemail/sdk
```

**send-email.ts**

```
import { init, openemail } from '@openemail/sdk'

init({ apiKey: process.env.OPENEMAIL_API_KEY })

await openemail.emails.send({
  from: 'Acme Billing <billing@acme.com>',
  to: 'ada@example.com',
  subject: 'Your September invoice',
  html: '<p>Invoice attached.</p>',
})
```

## Where to go

- [Install](https://openemail.uk/docs/sdk/install.md): Add it and send your first message.
- [Configuration](https://openemail.uk/docs/sdk/configuration.md): Every option, and what it refuses.
- [Send an email](https://openemail.uk/docs/sdk/emails/send.md): Every field on a message.
- [Threads](https://openemail.uk/docs/sdk/threads.md): Read, organise, snooze, attachments.
- [Webhooks](https://openemail.uk/docs/sdk/webhooks/endpoints.md): Register an endpoint and verify it.
- [Errors](https://openemail.uk/docs/sdk/errors.md): What throws, and how to narrow it.
- [Retries](https://openemail.uk/docs/sdk/retries.md): Why a retried send cannot duplicate.
- [Every method](https://openemail.uk/docs/sdk/reference/methods.md): The complete list, one row each.

## It wraps the API on the tab before this one

Everything here is the same surface the API reference documents, so read that for what an endpoint does and this for how to call it. There is one method for every documented operation, and the package's parity check reads the OpenAPI document to prove it.

- [API reference](https://openemail.uk/docs/api/overview.md): What each endpoint does, and how it fails.
