Skip to content

SDKs Overview

mailiam provides official SDKs for Node.js and browser environments, making it easy to integrate transactional email and forms into your applications.

The Node.js SDK is designed for server-side applications and provides full access to mailiam’s email sending capabilities.

Terminal window
npm install @mailiam/node

Use cases:

  • API routes (Next.js, Express, Fastify, etc.)
  • Background jobs and workers
  • Server-side email sending
  • Webhooks and integrations

Key features:

  • Send transactional emails
  • Batch email operations
  • Automatic retries with exponential backoff
  • Built-in rate limit handling
  • Full TypeScript support
  • Zero dependencies (uses native fetch)

View Documentation


The browser client is designed for client-side applications and provides safe form submission without exposing server secrets.

Terminal window
npm install @mailiam/client

Use cases:

  • Contact forms
  • Newsletter signups
  • Lead capture forms
  • Client-side form handling

Key features:

  • Browser-safe (no server secrets)
  • Optional public key authentication
  • CORS-friendly
  • Lightweight bundle size
  • TypeScript support

View Documentation


Feature@mailiam/node@mailiam/client
EnvironmentServer-sideBrowser
AuthenticationUsage/Admin keysPublic keys (optional)
Email sending✅ Full access
Form submissions
Batch operations
Automatic retries
Rate limits1000-10000/hour100/hour
Bundle size~7 KB~3 KB
  • Sending transactional emails from your backend
  • You need automatic retries and rate limit handling
  • You’re building API endpoints
  • You need batch sending capabilities
  • Building contact or signup forms
  • You want to submit directly from the browser
  • You don’t want to expose server secrets
  • You need a lightweight client-side solution
  • You have both server-side emails AND client-side forms
  • You want consistent error handling across your app
  • You’re building a full-stack application
import { mailiam } from '@mailiam/node';
const mailiam = new mailiam({
apiKey: process.env.MAILIAM_API_KEY
});
await mailiam.emails.send({
from: 'hello@mycompany.com',
to: 'customer@example.com',
subject: 'Welcome!',
html: '<h1>Welcome to our service</h1>'
});
import { mailiamClient } from '@mailiam/client';
const client = new mailiamClient({
publicKey: 'mlm_pk_...' // Optional
});
await client.submitForm('mycompany.com', {
name: 'John Doe',
email: 'john@example.com',
message: 'Hello!'
});

mailiam uses different key types for different use cases:

TypePrefixUsageRate LimitSDK
Publicmlm_pk_*Client-safe100/hour@mailiam/client
Usagemlm_sk_*Server-side1000/hour@mailiam/node
Adminmlm_sk_admin_*Full access10000/hour@mailiam/node

Create API keys using the mailiam CLI:

Terminal window
# Server-side key
mailiam keys create --name "Production" --type usage
# Client-safe key
mailiam keys create --name "Website" --type public --domain mycompany.com