Email SDK
Adapters

Postmark

Configure the fetch-based Postmark adapter.

The Postmark adapter calls the Postmark Email API directly. It does not add a runtime dependency.

Postmark logo
Postmark
email-sdk/postmark
import { createEmailClient } from "email-sdk";
import { postmark } from "email-sdk/postmark";

const email = createEmailClient({
  adapters: [
    postmark({
      serverToken: process.env.POSTMARK_SERVER_TOKEN!,
      messageStream: "outbound",
    }),
  ],
});

Send

await email.send({
  from: "Acme <hello@acme.com>",
  to: "user@example.com",
  subject: "Receipt",
  html: "<p>Thanks for your order.</p>",
  metadata: {
    orderId: "ord_123",
  },
});

Options

OptionTypeRequiredNotes
serverTokenstringYesPostmark server token.
baseUrlstringNoDefaults to https://api.postmarkapp.com.
messageStreamstringNoPostmark message stream.
fetchtypeof fetchNoUseful for tests or custom runtimes.
headersRecord<string, string>NoExtra request headers.

Response

The adapter maps Postmark MessageID to id and messageId.

On this page