Skip to content
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Install

Install Email SDK for Node.js 20+ or Bun 1.1+ with npm, pnpm, yarn or bun add, then send email from Bun or Node with ESM imports or CommonJS require.

Install the package

npm install @opencoredev/email-sdk

The public package is @opencoredev/email-sdk. The unscoped email-sdk package is unrelated.

Confirm your runtime

Use Node.js 20+ or Bun 1.1+. Every public entry point ships as both ESM and CommonJS, so import and require() work across the supported Node.js range.

For typed CommonJS, use module: nodenext. Use a .cts file with typed imports rather than an untyped bare require():

Import one adapter

Adapters use separate package entry points, so your application imports only the integrations it uses.

Verify the CLI

A project install exposes the email-sdk binary. The built CLI uses a Node shebang and also runs under Bun.

For a global Homebrew install, use brew install opencoredev/tap/email-sdk after the formula points at a published release.

Send email from Bun

Email SDK runs on Bun 1.1+ with no extra setup: install it with bun add @opencoredev/email-sdk, import an adapter, and run the file with bun. Bun loads .env files on its own, so the API key needs no dotenv import.

Provider API adapters such as Resend send with fetch, which Bun provides. To check sends without delivering email, use the memory adapter with bun test; see Test email sending.

For Nodemailer over SMTP, a plain fetch call and a Bun.serve route that sends email, see How to send email from Bun.

Quickstart

Create a client and send a validated message.

Provider credentials

Set the environment variables required by your adapter.

Last updated on