MCP-native for Cursor, Claude Code, and Windsurf
SDK

Node.js
SDK

The official Posthawk SDK for Node.js, Next.js, React, and Express. Full TypeScript support, zero dependencies, and built-in React Email integration. Send your first email in under a minute.

$ npm install posthawkposthawk
Simple API

Send emails with
four lines of code

Initialize the client, call send, and check the result. Every method returns { data, error } — no try/catch needed.

TypeScript
import { Posthawk } from 'posthawk';const posthawk = new Posthawk('ck_live_...');const { data, error } = await posthawk.emails.send({  from: 'hello@yourdomain.com',  to: 'user@example.com',  subject: 'Welcome!',  html: '<h1>Hello!</h1>',});if (error) {  console.error(error.message);} else {  console.log('Sent!', data.jobId);}
React Email
import { Posthawk } from 'posthawk';import { WelcomeEmail } from './emails/welcome';const posthawk = new Posthawk('ck_live_...');const { data, error } = await posthawk.emails.send({  from: 'hello@yourdomain.com',  to: 'user@example.com',  subject: 'Welcome aboard!',  react: WelcomeEmail({ name: 'Alex' }),});
React Email

Components, not
HTML strings

Pass React Email components via the react prop. The SDK renders them to HTML at send time. No manual rendering step needed.

Scheduling

Schedule, cancel,
and send now

Send later by adding scheduledFor. Full management API to list, cancel, reschedule, or send immediately with sendNow.

TypeScript
// Schedule for laterconst { data } = await posthawk.emails.send({  from: 'hello@yourdomain.com',  to: 'user@example.com',  subject: 'Reminder',  text: "Don't forget your meeting!",  scheduledFor: '2026-03-15T09:00:00Z',  timezone: 'America/New_York',});// Manage scheduled emailsconst list = await posthawk.scheduled.list();await posthawk.scheduled.cancel('id');await posthawk.scheduled.reschedule('id', {  scheduledFor: new Date('2026-04-01T10:00:00Z'),});// Send a scheduled email immediatelyawait posthawk.scheduled.sendNow('id');
TypeScript
// Create a newsletterconst { data: nl } = await posthawk.newsletters.create({  slug: 'weekly-digest',  name: 'Weekly Digest',  double_opt_in: true,});// Add a subscriberawait posthawk.newsletters.addSubscriber(nl.id, {  email: 'user@example.com',  name: 'Alex',});// Create and send an issueconst { data: issue } = await posthawk.newsletters.createIssue(nl.id, {  subject: 'Issue #1: Getting Started',  html: '<h1>Welcome!</h1><p>Your first issue.</p>',});await posthawk.newsletters.sendIssue(nl.id, issue.id);
Newsletters

Publish issues,
manage subscribers

Full newsletter management API — create newsletters, add subscribers, draft issues, and send to all active subscribers in one call.

Scale & deliverability

Batch sends &
a clean list

Queue up to 100 emails in one call with emails.batch, and manage the suppression list with suppressions so bounced and complained addresses never get hit again.

TypeScript
// Send up to 100 emails in a single callconst { data } = await posthawk.emails.batch([  { from: 'hi@you.com', to: 'a@example.com', subject: 'Hi', html: '<p>One</p>' },  { from: 'hi@you.com', to: 'b@example.com', subject: 'Hi', templateId: 't_welcome' },]);console.log(data.queued, data.failed);// Keep your sender reputation cleanawait posthawk.suppressions.create({ email: 'bounced@example.com' });const { data: list } = await posthawk.suppressions.list();
Complete coverage

One client,
the whole API

Every Posthawk endpoint is a typed method on the client — no raw HTTP, no guessing at shapes.

posthawk.emails

send · get · batch

posthawk.scheduled

list · get · cancel · reschedule · sendNow

posthawk.broadcasts

create · list · send · cancel

posthawk.newsletters

issues · subscribers · CRUD

posthawk.contacts

list · create · update · import

posthawk.domains

verify · receiving · limits · webhook

posthawk.webhooks

create · update · test · delete

posthawk.suppressions

list · create · delete

posthawk.templates

render

Getting started

Up and running
in minutes

01

Install the package

One command to add Posthawk to your project. Works with npm, pnpm, yarn, and bun.

02

Create a client

Initialize with your API key. The SDK handles auth headers, serialization, and error wrapping.

03

Send your first email

Call posthawk.emails.send() with your content. Get back a typed response with delivery status.

React Email Support

Pass React Email components directly via the react prop. The SDK renders them to HTML automatically.

Zero Dependencies

Uses native fetch — no bloated HTTP clients. Ships as ESM and CommonJS with full TypeScript declarations.

Schedule Emails

Schedule, list, cancel, and reschedule emails. Accepts Date objects or ISO 8601 strings.

Never Throws

Every method returns { data, error } — no try/catch needed. Type-safe discriminated unions.

Start sending emails

Install the SDK and send your first email in under a minute.

Cookie Preferences

I use analytics cookies to understand how you use the site and improve your experience. Privacy Policy