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

@mxplane/bobtailmail

v0.1.0

Published

Official Node/TypeScript SDK for the BobtailMail API

Readme

@mxplane/bobtailmail

Official Node/TypeScript SDK for the BobtailMail API — a transactional email API where agents are first-class senders. This package is a thin, typed client over the same REST contract documented at bobtailmail.com/docs and published as openapi.json; it adds nothing the API itself doesn't do.

Install

npm install @mxplane/bobtailmail

Usage

import { BobtailMail } from "@mxplane/bobtailmail";

const bobtail = new BobtailMail({ apiKey: process.env.BOBTAILMAIL_API_KEY! });

const message = await bobtail.messages.send({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Your receipt",
  text: "Thanks!",
});

console.log(message.id, message.status);

to/cc/bcc/replyTo accept a single address or an array. At least one of text/html is required. Pass an idempotency key as the second argument to send to make retries safe:

await bobtail.messages.send(input, "order-42-confirmation");

Domains

A message can only send from an address at a domain you've registered and verified:

const domain = await bobtail.domains.create({ name: "notify.yourdomain.com" });
console.log(domain.dnsRecords); // the exact records to set

// after setting DNS — verification can take several minutes to reflect propagation
const status = await bobtail.domains.verify(domain.id);

Webhooks

import { verifyWebhookSignature } from "@mxplane/bobtailmail";

const valid = verifyWebhookSignature({
  secret: endpointSecret, // whsec_... from webhookEndpoints.create()
  rawBody, // the exact, unparsed request body your server received
  signature: req.headers["x-bobtailmail-signature"],
  timestamp: req.headers["x-bobtailmail-timestamp"],
});

Verify against the raw request body — signing covers the exact bytes sent, not a re-serialized object. Rejects anything older than 5 minutes by default (toleranceSeconds to override).

Errors

Every non-2xx response throws BobtailMailError, carrying the API's own typed envelope:

import { BobtailMailError } from "@mxplane/bobtailmail";

try {
  await bobtail.messages.send(input);
} catch (err) {
  if (err instanceof BobtailMailError) {
    console.log(err.type, err.status, err.details);
    // e.g. "send_rejected", 422, { rejection: { kind: "unverified_domain", ... } }
  }
}

Full error type reference: bobtailmail.com/docs#errors.

License

MIT