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

@esaart/posta

v0.1.0

Published

Official Node/TypeScript client for the POSTA email API.

Downloads

32

Readme

posta

Official Node/TypeScript client for the POSTA email API.

npm install @esaart/posta

Usage

import { Posta } from "@esaart/posta";

const posta = new Posta("pa_xxxxxxxx", {
  // baseUrl defaults to https://posta.esaart.studio
  baseUrl: "http://localhost:3000",
});

// Send an email
const { id, status } = await posta.emails.send({
  from: "ESAART <[email protected]>",
  to: "[email protected]",
  subject: "Welcome to ESAART 🎉",
  html: "<h1>You are in!</h1>",
});

// List recent emails
const { data } = await posta.emails.list({ limit: 20 });

API

new Posta(apiKey, options?)

  • apiKey — your pa_… key (create one in the dashboard → API Keys).
  • options.baseUrl — Posta deployment URL. Default https://posta.esaart.studio.
  • options.fetch — custom fetch implementation (optional).
  • options.timeoutMs — request timeout. Default 30000.
  • options.retries — retries for 429/5xx responses. Default 2.

posta.emails.send(params)SendEmailResult

from (required), to (string | string[], required), subject (required unless a template supplies one), html and/or text. Optional: replyTo, template

  • variables, headers, attachments, idempotencyKey, scheduledAt.
// Template + variables
await posta.emails.send({
  from: "ESAART <[email protected]>",
  to: "[email protected]",
  template: "welcome",
  variables: { name: "Alex" },
});

// Attachments (base64), custom headers, idempotency, scheduled send
await posta.emails.send({
  from: "ESAART <[email protected]>",
  to: ["[email protected]", "[email protected]"],
  subject: "Your receipt",
  html: "<p>Thanks!</p>",
  replyTo: "[email protected]",
  headers: { "X-Entity-Ref-ID": "order_123" },
  attachments: [{ filename: "receipt.pdf", content: base64Pdf, contentType: "application/pdf" }],
  idempotencyKey: "order_123",        // a repeat with the same key won't send twice
  scheduledAt: "2026-06-20T09:00:00Z", // ISO 8601 — future-dates the send
});

posta.emails.batch.send(emails[]){ object, data }

Up to 100 emails per request (each item supports the same fields as send, including attachments/headers). Each result carries an id or an error.

posta.emails.list({ limit }){ object, data }

posta.emails.validate(email) / posta.emails.validateBatch(emails[])

Pre-send hygiene (syntax, disposable, typo, role, MX) → { valid, risk, reason, checks }.

Posta.webhooks.verify(rawBody, signature, secret)boolean

Verify the Posta-Signature header (HMAC-SHA256) on an incoming webhook with that endpoint's secret. Works in Node 18+, browsers, Deno and edge runtimes.

Errors throw a PostaError with .status and .message.

Build / publish

npm install
npm run build   # emits dist/ (JS + .d.ts)
npm publish

Zero runtime dependencies — uses the global fetch (Node 18+, Bun, Deno, edge, browsers).