SDK Introduction

Understand what the Lumail TypeScript SDK is for and when to use it in your application.

The Lumail TypeScript SDK is the easiest way to integrate the Lumail API into a JavaScript or TypeScript project. It gives you a typed client for subscribers, campaigns, transactional emails, tags, events, and Lumail tools.

It is built for web apps, SaaS backends, serverless functions, internal dashboards, and scripts. It is not a separate AI-agent runtime. If you are connecting Claude, Cursor, or another assistant directly to Lumail, use the MCP integration. If you need language-agnostic access, use the REST API or Tools API.

Install

pnpm add lumail

Quick Start

import { Lumail } from "lumail";

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

const { subscriber } = await lumail.subscribers.create({
  email: "[email protected]",
  name: "Jane Doe",
  tags: ["newsletter"],
  triggerWorkflows: true,
});

await lumail.events.create({
  eventType: "SUBSCRIBED",
  subscriber: subscriber.email,
  data: { source: "signup-form" },
});

Common Integration Points

Integration pointWhat the SDK does
Signup formsCreate or update subscribers and trigger workflows
Checkout flowsTag customers, store plan fields, and track payment events
Product eventsRecord subscriber activity for segmentation and analytics
Transactional emailSend email from a verified domain
Internal admin toolsSearch, update, tag, or unsubscribe subscribers
Scheduled jobsCreate, schedule, and send campaigns from backend code

Choose the Right Lumail Interface

InterfaceBest for
TypeScript SDKJavaScript or TypeScript apps that want typed API access
REST APIAny language or framework
Tools APICalling Lumail tool actions through one endpoint
MCPLetting AI assistants discover and call Lumail tools directly
CLITerminal workflows and shell scripts

Next Steps