Documentation

Get started with PostaSend

Everything you need to integrate transactional email into your application, from quick start to advanced multi-tenant configurations.

Quick start

01

Create an account

Sign up at postasend.com. Free, no credit card required.

02

Get your API key

Navigate to Settings → API Keys and create a new key.

03

Install the SDK

Add postasend to your project with your package manager.

04

Verify a domain

Add a custom sending domain in Settings → Domains.

05

Send your first email

Call client.emails.send() and check the dashboard for delivery status.

Installation

Install the PostaSend SDK using your preferred package manager.

npm install postasend

Authentication

PostaSend authenticates your requests using API keys. Your API key carries your account privileges, so keep it secret. Store it as an environment variable. Never commit it to source control.

import { PostaSend } from 'postasend';

// Initialize with your API key
const client = new PostaSend({
  apiKey: process.env.POSTASEND_API_KEY!,
});

// Or pass the key directly (not recommended for production)
const client2 = new PostaSend({ apiKey: 'ps_live_...' });

Security tip: Use environment variables for your API key. If a key is ever exposed, immediately rotate it in the PostaSend dashboard under Settings → API Keys.

Send your first email

With authentication configured, you can send your first email in a single API call.

import { PostaSend } from 'postasend';

const client = new PostaSend({
  apiKey: process.env.POSTASEND_API_KEY!,
});

const response = await client.emails.send({
  from: 'hello@yourdomain.com',
  to: ['user@example.com'],
  subject: 'Welcome to our app!',
  html: '<h1>Welcome!</h1><p>Your account is ready.</p>',
  text: 'Welcome! Your account is ready.',
  // Optional headers
  headers: {
    'X-Entity-Ref-ID': 'user-123-welcome',
  },
});

console.log(response.messageId); // 'msg_abc123'
console.log(response.status);    // 'queued'

The response includes a messageId you can use to track delivery status, and a status field that will be queued immediately after submission.

Explore the docs