Skip to main content
Docs/SDKs

SDKs & Libraries

Official SendMesh SDKs for the most popular server-side languages. All SDKs wrap the REST API with language-native idioms, type safety, and built-in retry logic.

Installation

bash
npm install @sendmesh/node

Package: @sendmesh/node

Quick Start

typescript
import { SendMesh } from '@sendmesh/node';

const client = new SendMesh('sk_live_your_key_here');

// Send a single email
const { data } = await client.emails.send({
  from: { email: 'hello@yourdomain.com', name: 'Your App' },
  to: [{ email: 'user@example.com', name: 'Jane Doe' }],
  subject: 'Welcome to Our App!',
  html: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  tags: ['welcome', 'transactional'],
});

console.log('Sent:', data.id);

// Send a batch
const batch = await client.emails.batch({
  from: { email: 'hello@yourdomain.com' },
  messages: [
    { to: [{ email: 'user1@example.com' }], subject: 'Hello 1', html: '<p>Hi 1</p>' },
    { to: [{ email: 'user2@example.com' }], subject: 'Hello 2', html: '<p>Hi 2</p>' },
  ],
});

console.log('Batch ID:', batch.data.batchId);

// List contacts
const contacts = await client.contacts.list({ limit: 50 });
console.log('Contacts:', contacts.data.length);

// Verify webhook signature
const isValid = client.webhooks.verifySignature(
  payload, signature, 'whsec_your_secret'
);

Features

  • Full TypeScript support with detailed types
  • Automatic retries with exponential backoff
  • Webhook signature verification helper
  • Streaming support for large batch sends
  • Promise-based API with async/await

Full Node.js SDK Documentation

Complete method reference with params, return types, and examples.

View Full Docs

Node.js SDK on GitHub

View source, report issues, and contribute.

View Repository

Using a different language? The REST API works with any HTTP client. All endpoints accept JSON and return JSON.