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

zasend-node

v0.1.1

Published

Node.js SDK for the zaSend transactional email API and SMTP service

Readme

zasend-node

License: MIT Node

Official Node.js client for the zaSend transactional email API.

zaSend is a developer-focused email delivery service for sending product, auth, billing, notification, and lifecycle emails from your application. This package is a small wrapper around the zaSend REST API for Node.js, Next.js, Express, NestJS, background jobs, and scripts.

Use it to:

  • Send transactional email from verified domains
  • Send template-based email with variables
  • Check message status and events
  • Manage suppressions, webhooks, templates, and domains
  • Verify zaSend webhook signatures

The client stays close to the raw API. It has no runtime dependencies and uses the built-in fetch available in Node 18+.

Install

npm install zasend-node

Quick Start

const { ZaSend } = require("zasend-node");

const zasend = new ZaSend(process.env.ZASEND_API_KEY);

const result = await zasend.sendEmail({
  from: "zaSend <[email protected]>",
  to: "[email protected]",
  subject: "Welcome",
  text: "Thanks for signing up.",
});

console.log(result.message_id);

You can use an Account API Key (sk_live_...) for all methods. A Domain Sending Key (dsk_live_...) is restricted to sending email from one verified domain.

Send HTML Email

await zasend.sendEmail({
  from: "Acme <[email protected]>",
  to: "[email protected]",
  subject: "Your receipt",
  html: "<h1>Thanks for your order</h1><p>Your receipt is attached.</p>",
  text: "Thanks for your order. Your receipt is attached.",
});

Send to Multiple Recipients

await zasend.sendEmail({
  from: "Acme <[email protected]>",
  to: ["[email protected]", "[email protected]"],
  subject: "Product update",
  text: "A new update is available.",
});

zaSend returns one queued message per to recipient. Suppressed recipients reject the whole request so you can fix the list before sending.

Template Send

await zasend.sendTemplateEmail({
  from: "Acme <[email protected]>",
  to: "[email protected]",
  template: "welcome",
  variables: { name: "Ada" },
});

Next.js / Express Example

const { ZaSend } = require("zasend-node");

const zasend = new ZaSend(process.env.ZASEND_API_KEY);

async function sendSignupEmail(email) {
  return zasend.sendTemplateEmail({
    from: "Acme <[email protected]>",
    to: email,
    template: "welcome",
    variables: { product: "Acme" },
  });
}

Webhook Verification

zaSend signs webhook payloads with HMAC-SHA256. Verify the raw request body before trusting webhook data.

const { verifyWebhookSignature } = require("zasend-node");

const ok = verifyWebhookSignature(
  request.rawBody,
  process.env.ZASEND_WEBHOOK_SECRET,
  request.headers["x-zasend-signature"]
);

API Methods

| Method | Description | | --- | --- | | sendEmail(message) | Send direct content or a template email | | sendTemplateEmail(options) | Convenience wrapper for template sends | | getEmail(messageId) | Fetch email status and events | | getRateLimits() | Fetch daily usage and limits | | listDomains() / addDomain(domain) / verifyDomain(id) / deleteDomain(id) | Manage sending domains | | listSuppressions(options) / addSuppression(email, options) / deleteSuppression(id) | Manage suppression list entries | | listWebhooks() / createWebhook(url, events) / deleteWebhook(id) | Manage signed delivery webhooks | | listTemplates() / createTemplate(template) / getTemplate(id) / updateTemplate(id, template) / deleteTemplate(id) | Manage email templates |

Error Handling

const { APIError, RateLimitError, ValidationError, ZaSend } = require("zasend-node");

try {
  await new ZaSend(process.env.ZASEND_API_KEY).sendEmail({
    from: "Acme <[email protected]>",
    to: "[email protected]",
    subject: "Hello",
    text: "Body",
  });
} catch (error) {
  if (error instanceof RateLimitError) {
    console.log("Rate limited:", error.message);
  } else if (error instanceof ValidationError) {
    console.log("Invalid request:", error.message);
  } else if (error instanceof APIError) {
    console.log("zaSend API error:", error.message);
  } else {
    throw error;
  }
}

Links

License

MIT