Official Node.js SDK and CLI tools for the Lettr transactional email service.
| Package | Description |
|---|---|
lettr |
Core SDK — type-safe API client for emails, templates, domains, webhooks, audience, and campaigns |
lettr-kit |
CLI tool for managing Lettr email templates locally |
npm install lettrimport { Lettr } from "lettr";
const client = new Lettr(process.env.LETTR_API_KEY!);
const { data, error } = await client.emails.send({
from: "sender@example.com",
to: ["recipient@example.com"],
subject: "Welcome!",
html: "<h1>Hello!</h1>",
});
if (error) {
console.error(error.message); // error.type: "validation" | "api" | "network"
} else {
console.log(data.request_id);
}Every method returns a Result<T> ({ data, error }) — the SDK never throws for API or network failures.
📚 docs.lettr.com/quickstart/nodejs — full guides for sending, templates, domains, webhooks, audience, and campaigns, plus the API reference.
npm install -g lettr-kit
lettr-kit init # Interactive setup — creates lettr.json
lettr-kit list # List all templates with sync status
lettr-kit pull # Pull templates as HTML files
lettr-kit pull --all # Pull all templates without promptingThis is a monorepo using Bun workspaces.
bun install
bun run build
bun run testMIT