Skip to the documentation
SDK

Install

One package, no dependencies, every server runtime.

Install

The first release is 0.0.1. Every documented operation has a method, the package’s parity check fails the build when one goes missing, and the API it wraps is on in every environment.

pnpm add @openemail/sdk
send-email.ts
import { init, openemail } from '@openemail/sdk' init({ apiKey: process.env.OPENEMAIL_API_KEY }) const email = await openemail.emails.send({  from: 'Acme Billing <[email protected]>',  to: '[email protected]',  subject: 'Your September invoice',  html: '<p>Invoice attached.</p>',}) console.log(email.id, email.status)

init configures the shared openemail client once, and every module that imports openemail afterwards gets that client. Skip it and the first call builds the client from OPENEMAIL_API_KEY instead.

send() resolving does not mean the message has gone. A scheduled or cancellable send comes back queued or scheduled and settles later. Read status, not the fact that the promise resolved.

Where it runs

Zero runtime dependencies, on Node 20+, Bun, Deno and Cloudflare Workers. It uses the global fetch and nothing else, and you can hand it your own.

ESM and CommonJS both ship, each with its own type declarations, so import { openemail } from '@openemail/sdk' and const { openemail } = require('@openemail/sdk') both work.

Not in a browser. The client carries a workspace API key that can send mail and read the mailbox, so it refuses to start where window and document exist. Disposable inboxes are the exception: createTempMail() needs no key and runs in a page.

This is a **TypeScript/JavaScript** client, and there is no Python, Go, PHP or Ruby package. From another language the API is plain HTTP and JSON: the quickstart carries a working request in eight languages, and the OpenAPI document generates a client in most of the rest.