Get Started
Send your first transactional email with the OpenSES Node.js SDK.
Install
npm install @openses/opensesOpenSES requires Node.js 18 or newer and has no runtime dependencies.
Create a client
import { OpenSES } from '@openses/openses';
const client = new OpenSES({
apiKey: process.env.OPENSES_API_KEY,
baseUrl: 'https://email.mycompany.com',
});OpenSES is currently available for self-hosted deployments only. Set baseUrl to your own OpenSES API origin.
The client also accepts a string API-key shorthand, but use the object form above while self-hosting so you can set baseUrl:
const client = new OpenSES('opk_live_...');When no argument is provided, the SDK reads OPENSES_API_KEY.
Send an email
const { id } = await client.emails.send({
from: 'Acme <noreply@acme.com>',
to: 'user@example.com',
subject: 'Your order is confirmed',
html: '<p>Order #1042 is on its way.</p>',
});The send call returns once OpenSES has queued the email. Use emails.get(id) or webhooks to follow delivery.
Self-hosted deployments
const client = new OpenSES({
apiKey: process.env.OPENSES_API_KEY,
baseUrl: 'https://email.mycompany.com',
});Continue with API architecture or the email API.