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

Quickstart

Send your first email from TypeScript or Node.js with Email SDK: set a Resend API key, create a client, send, and check messages without sending.

Install the package:

npm install @opencoredev/email-sdk

Set a server-only Resend key:

Then create the client and send:

Replace from with an address on a domain you verified in Resend, and to with your own inbox. Then run it. Bun loads .env.local on its own:

On Node.js 20.6 or later, load the file with --env-file, for example through tsx. The sample uses top-level await, so the project needs "type": "module" in package.json:

That is the whole happy path. The result tells you which adapter ran and includes the provider receipt when one is available.

Check a message without sending

Use validate when you want the same message and routing checks without a provider send request:

Check from the CLI

--dry-run runs the same validation without sending email.

Sending from a Next.js form? See Send email from a Next.js server action.

Standalone starter

A runnable copy of this page for Node 20+ or Bun, with .env loading.

Add retries and fallback

Choose retry counts and unknown-delivery policy deliberately.

Schedule an email

Use provider scheduling now, or an app-owned queue when you need more control.

Test without a provider

Capture sends with the memory adapter and capture plugin.

Last updated on