SDK 2.1.0

[email protected] talks only to API v2 and returns { data, error }.

npm i [email protected]. Base URL https://lumail.io/api. Bearer lum_ token. Methods return { data, error } — no try/catch for ordinary API errors. Missing API key still throws at construction.

import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY! });

const { data, error } = await lumail.emails.send(
  {
    from: "[email protected]",
    to: "[email protected]",
    subject: "Welcome",
    html: "<p>Hello</p>",
  },
  { idempotencyKey: "welcome-1" },
);

Network, timeout, and abort errors use error.name of network_error, timeout, or aborted and do not invent an HTTP statusCode.

Optional baseUrl for self-hosted or beta.

Resources

v1 HTTP stays frozen. New code uses v2. Rewrite guide: Migration to V2. v2 send accepts html, tiptap, or markdown.