
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Official Posthawk SDK for sending emails. TypeScript-first with React Email support.
npm install posthawk
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);
}
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: 'hello@yourdomain.com',
to: 'user@example.com',
subject: 'Welcome aboard!',
react: WelcomeEmail({ name: 'Alex' }),
});
Send later by adding scheduledFor — accepts ISO 8601 strings or Date objects.
const { data, error } = await posthawk.emails.send({
from: 'hello@yourdomain.com',
to: 'user@example.com',
subject: 'Reminder',
text: "Don't forget your meeting tomorrow!",
scheduledFor: '2026-03-15T09:00:00Z',
timezone: 'America/New_York',
});
const { data, error } = await posthawk.emails.get('job-id');
if (data) {
console.log(data.status); // 'pending' | 'processing' | 'completed' | 'failed'
}
// 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'),
});
Point the SDK to your own Posthawk instance:
const posthawk = new Posthawk({
apiKey: 'ck_live_...',
baseUrl: 'https://api.yourdomain.com',
});
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);
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.
MIT
FAQs
Official Posthawk SDK for sending emails
We found that posthawk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.