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

@poststack.dev/sdk

v0.5.1

Published

Official TypeScript SDK for the PostStack Email API

Downloads

450

Readme

@poststack.dev/sdk

Official TypeScript SDK for the PostStack Email API — a GDPR-compliant, EU-hosted alternative to Resend, SendGrid, and Postmark with built-in mailboxes, broadcasts, and real-time analytics.

Full API reference: poststack.dev/docs/sdk.

Installation

npm install @poststack.dev/sdk
# or
bun add @poststack.dev/sdk

Quick Start

import { PostStack } from '@poststack.dev/sdk';

const client = new PostStack('sk_live_...');

// Send an email
const { id } = await client.emails.send({
	from: '[email protected]',
	to: ['[email protected]'],
	subject: 'Hello!',
	html: '<p>Welcome!</p>',
});

Resources

client.emails

Send, batch, list, get, reschedule, and cancel emails. Retrieve per-email events and deliverability insights.

// Send a single email
await client.emails.send({ from: '...', to: ['...'], subject: '...', html: '...' });

// Batch send
await client.emails.batch({ emails: [...] });

// Get email events
const { events } = await client.emails.getEvents(emailId);

// Get deliverability insights / warnings
const { warnings } = await client.emails.getInsights(emailId);

client.domains

Manage sending domains, verify DNS records, assign dedicated IPs, and access DMARC reports.

// Create and verify a domain
const domain = await client.domains.create({ name: 'mail.example.com' });
await client.domains.verify(domain.id);

// Assign a dedicated IP
await client.domains.assignIp(domain.id, ipAddressId);

// DMARC reports
const reports = await client.domains.getDmarcReports(domain.id);
const stats = await client.domains.getDmarcStats(domain.id, 30); // last 30 days
const sources = await client.domains.getDmarcSources(domain.id);

client.contacts

Create, update, list, import, export, and manage contacts.

// Create a contact
await client.contacts.create({ email: '[email protected]', first_name: 'Jane' });

// Bulk import contacts
const result = await client.contacts.import({
	contacts: [{ email: '[email protected]' }, { email: '[email protected]' }],
	update_existing: true,
});

// Export all contacts as CSV
const csv = await client.contacts.exportCsv();

client.contactProperties

Define custom properties for contacts.

// List all custom properties
const { properties } = await client.contactProperties.list();

// Create a new property
await client.contactProperties.create({
	name: 'plan',
	label: 'Plan',
	type: 'select',
	options: ['free', 'pro', 'enterprise'],
});

// Update or delete
await client.contactProperties.update(id, { label: 'Subscription Plan' });
await client.contactProperties.delete(id);

client.segments

Create and manage contact segments, including rule-based preview.

// Preview how many contacts match a rule set before saving
const preview = await client.segments.previewRules({
	rules: [{ field: 'plan', operator: 'eq', value: 'pro' }],
	logic: 'and',
});

// Add / remove contacts
await client.segments.addContacts(segmentId, { contact_ids: ['...'] });
await client.segments.removeContact(segmentId, contactId);

client.subscriptionTopics

Manage opt-in topics and contact subscriptions.

// Create a topic
const { topic } = await client.subscriptionTopics.create({ name: 'Product updates' });

// Subscribe / unsubscribe a contact
await client.subscriptionTopics.subscribe(contactId, topic.id);
await client.subscriptionTopics.unsubscribe(contactId, topic.id);

// Get all subscriptions for a contact
const { subscriptions } = await client.subscriptionTopics.getContactSubscriptions(contactId);

client.templates

Email templates with versioning, presets, publish/unpublish, and duplicate.

// Use a built-in preset as a starting point
const { presets } = await client.templates.getPresets();
const template = await client.templates.usePreset(presets[0].id);

// Duplicate an existing template
const copy = await client.templates.duplicate(templateId);

// Publish for use in broadcasts / API sends
await client.templates.publish(templateId);

client.broadcasts

Marketing email broadcasts with A/B variant tracking.

// Create and send a broadcast
const { broadcast } = await client.broadcasts.create({
	segment_id: segmentId,
	from: '[email protected]',
	subject: 'Monthly update',
	html: '<p>...</p>',
});
await client.broadcasts.send(broadcast.publicId);

// A/B variant results
const { variants } = await client.broadcasts.getVariants(broadcast.publicId);
const stats = await client.broadcasts.getVariantStats(broadcast.publicId);

client.webhooks

Webhook endpoint management including delivery history and replay.

// List delivery history
const deliveries = await client.webhooks.getDeliveries(webhookId);

// Replay a failed delivery
await client.webhooks.replay(webhookId, deliveryId);

client.suppressions

Manage the suppression / unsubscribe list.

await client.suppressions.add({ email: '[email protected]', reason: 'hard_bounce' });
await client.suppressions.remove('[email protected]');

client.workflows

Automated email workflows triggered by contact events or manually.

// Create a workflow
const { workflow } = await client.workflows.create({
	name: 'Welcome series',
	trigger_type: 'contact.created',
});

// Add a step
await client.workflows.addStep(workflow.publicId, {
	step_type: 'send_email',
	config: { template_id: '...', delay_minutes: 0 },
	position: 1,
});

// Activate
await client.workflows.activate(workflow.publicId);

// Manually trigger for a specific contact
await client.workflows.trigger(workflow.publicId, { contact_id: 42 });

client.signupForms

Embeddable signup forms that add contacts to segments and subscribe to topics.

// Create a form
const form = await client.signupForms.create({
	name: 'Newsletter signup',
	segment_id: segmentId,
	topic_id: topicId,
	success_message: 'Thanks for subscribing!',
});

// Submit (public, no auth required — call from your frontend)
await client.signupForms.submit(form.publicId, { email: '[email protected]' });

client.emailValidations

Validate email addresses before sending to reduce bounces.

// Single validation
const result = await client.emailValidations.validate('[email protected]');
console.log(result.result); // 'deliverable' | 'undeliverable' | 'risky' | 'unknown'

// Batch validation
const { results } = await client.emailValidations.validateBatch(['[email protected]', '[email protected]']);

client.mailboxes

Managed IMAP/POP3 mailboxes and aliases.

// Create a mailbox
const { mailbox } = await client.mailboxes.create({
	domainId: domain.id,
	localPart: 'support',
	password: 'securepassword',
});

// Create an alias
await client.mailboxes.createAlias({
	domainId: domain.id,
	localPart: 'help',
	destinationMailboxId: mailbox.id,
});

client.apiKeys

Create and manage API keys (requires session auth).

const key = await client.apiKeys.create({ name: 'Production', permission: 'sending_access' });
await client.apiKeys.revoke(key.id);

Links