npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

posthawk

v0.4.0

Published

Official Posthawk SDK + CLI for sending transactional email

Readme

posthawk

Official Posthawk SDK for sending emails. TypeScript-first with React Email support.

Install

npm install posthawk

Quick Start

import { Posthawk } from 'posthawk';

const posthawk = new Posthawk('ck_live_...');

const { data, error } = await posthawk.emails.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Welcome!',
  html: '<h1>Hello!</h1>',
});

if (error) {
  console.error(error.message);
} else {
  console.log('Sent!', data.jobId);
}

React Email

Use React Email components directly — no manual rendering needed.

npm install @react-email/render
import { Posthawk } from 'posthawk';
import { WelcomeEmail } from './emails/welcome';

const posthawk = new Posthawk('ck_live_...');

const { data, error } = await posthawk.emails.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Welcome aboard!',
  react: WelcomeEmail({ name: 'Alex' }),
});

Schedule Emails

Send later by adding scheduledFor — accepts ISO 8601 strings or Date objects.

const { data, error } = await posthawk.emails.send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Reminder',
  text: "Don't forget your meeting tomorrow!",
  scheduledFor: '2026-03-15T09:00:00Z',
  timezone: 'America/New_York',
});

Check Delivery Status

const { data, error } = await posthawk.emails.get('job-id');

if (data) {
  console.log(data.status); // 'pending' | 'processing' | 'completed' | 'failed'
}

Manage Scheduled Emails

// List scheduled emails
const { data } = await posthawk.scheduled.list();

// Get a specific scheduled email
const { data } = await posthawk.scheduled.get('scheduled-id');

// Cancel a scheduled email
await posthawk.scheduled.cancel('scheduled-id');

// Reschedule to a new time
await posthawk.scheduled.reschedule('scheduled-id', {
  scheduledFor: new Date('2026-04-01T10:00:00Z'),
});

Self-Hosted

Point the SDK to your own Posthawk instance:

const posthawk = new Posthawk({
  apiKey: 'ck_live_...',
  baseUrl: 'https://api.yourdomain.com',
});

Error Handling

SDK methods never throw for API errors. Every method returns { data, error }:

const { data, error } = await posthawk.emails.send({ ... });

if (error) {
  console.error(error.message);    // Human-readable error message
  console.error(error.statusCode); // HTTP status code (e.g. 400, 429)
  return;
}

// data is guaranteed to be non-null here
console.log(data.jobId);

API Reference

posthawk.emails.send(params)

Send an email or schedule one for later delivery.

| Parameter | Type | Required | Description | | -------------- | ------------------------ | -------- | ------------------------------------------ | | from | string | Yes | Sender email (must be from verified domain) | | to | string \| string[] | Yes | Recipient(s) | | cc | string \| string[] | No | CC recipient(s) | | bcc | string \| string[] | No | BCC recipient(s) | | subject | string | Yes | Subject line | | html | string | No* | HTML body | | text | string | No* | Plain text body | | react | ReactElement | No* | React Email component | | templateId | string | No | Posthawk template ID | | variables | Record<string, string> | No | Template variables | | headers | Record<string, string> | No | Custom email headers | | scheduledFor | string \| Date | No | Schedule for later (ISO 8601 or Date) | | timezone | string | No | IANA timezone | | metadata | Record<string, unknown>| No | Custom metadata | | tags | Record<string, unknown>| No | Custom tags |

* At least one of html, text, react, or templateId is required.

posthawk.emails.get(jobId)

Get the delivery status of a queued email.

posthawk.scheduled.list(params?)

List scheduled emails. Optional filters: status, limit, offset.

posthawk.scheduled.get(id)

Get a specific scheduled email.

posthawk.scheduled.cancel(id)

Cancel a scheduled email before it sends.

posthawk.scheduled.reschedule(id, { scheduledFor })

Change the send time of a scheduled email.

License

MIT