Install
Install Email SDK for Node.js or Bun using ESM imports or CommonJS require.
Install the package
npm install @opencoredev/email-sdkThe 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.
const { createEmailClient } = require("@opencoredev/email-sdk");
const { resend } = require("@opencoredev/email-sdk/resend");For typed CommonJS, use module: nodenext. Use a .cts file with typed imports rather than an untyped bare require():
import sdk = require("@opencoredev/email-sdk");
import { resend } from "@opencoredev/email-sdk/resend";
const email = sdk.createEmailClient({
adapters: [resend({ apiKey: process.env.RESEND_API_KEY! })],
});Import one adapter
Adapters use separate package entry points, so your application imports only the integrations it uses.
import { createEmailClient } from "@opencoredev/email-sdk";
import { resend } from "@opencoredev/email-sdk/resend";Verify the CLI
A project install exposes the email-sdk binary. The built CLI uses a Node shebang and also runs under Bun.
npx --package @opencoredev/email-sdk email-sdk version
npx --package @opencoredev/email-sdk email-sdk adaptersFor a global Homebrew install, use brew install opencoredev/tap/email-sdk after the formula points at a published release.
Quickstart
Create a client and send a validated message.
Provider credentials
Set the environment variables required by your adapter.