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

@msgly/ses

v1.4.0

Published

Amazon SES adapter for Msgly — high-volume email with SigV4 signing and SNS bounce handling

Readme

@msgly/ses

📖 Docs & channel reference: https://ayushjain070401.github.io/msgly/

Amazon SES adapter for Msgly — built for high-volume campaign email.

SES is roughly 10× cheaper than most transactional providers at scale ($0.10 per 1,000 emails), which is the economics that matter when you send to a list. Edge-compatible: SigV4 signing is implemented on Web Crypto, so there's no AWS SDK dependency.

npm install @msgly/core @msgly/ses
import { createHub, createInMemorySuppressionStore, applyDeliveryReceipt } from '@msgly/core';
import { createSesAdapter } from '@msgly/ses';

const suppression = createInMemorySuppressionStore();

const ses = createSesAdapter({
  region: 'us-east-1',
  credentials: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
  },
  from: 'Acme <[email protected]>',
  configurationSetName: 'acme-events',   // required for SNS event publishing
  unsubscribe: { url: 'https://acme.com/u?e={{contact}}' },
});

const hub = createHub({ suppressionStore: suppression }).register(ses);

Bounce handling is not optional here

SES suspends accounts over roughly 5% bounces or 0.1% complaints. Unlike most providers, ignoring this costs you the account.

SES gives you the cleanest signal of any adapter in this repo — its notifications carry an explicit bounceType of Permanent or Transient, which maps directly onto core's suppression model:

app.post('/webhook/ses', async (req, res) => {
  for (const receipt of ses.parseDeliveryEvents(req)) {
    await applyDeliveryReceipt(receipt, 'ses', suppression);
  }
  res.sendStatus(200);
});

Permanent bounces and complaints suppress the recipient. Transient ones (mailbox full) are left alone.

SNS setup

  1. Create an SNS topic and subscribe your endpoint to it
  2. Point a configuration set at the topic for Bounce, Complaint, Delivery
  3. Set configurationSetNamewithout it SES publishes no events at all

SNS requires confirming the subscription once:

const url = ses.getSubscriptionConfirmationUrl(req);
if (url) await fetch(url);   // one-time, activates the topic

⚠️ The sandbox

A new SES account is sandboxed: it only delivers to verified addresses, so a campaign silently reaches almost nobody. verifyCredentials() calls this out explicitly rather than letting you discover it from an empty campaign:

[email protected] via us-east-1 — SANDBOX: only verified recipients will receive mail

Request production access in the SES console before sending to a real list.

⚠️ Signature verification is partial

verifySignature validates that the SNS SigningCertURL is genuinely AWS-hosted (https, an sns.<region>.amazonaws.com host, a .pem path) and reachable. That blocks the main attack — an attacker pointing the cert URL at their own key to forge bounce events and suppress your recipients.

It does not verify the RSA signature itself, because that needs X.509 parsing which Web Crypto doesn't provide. Rather than ship a check that looks like verification but isn't, this is stated plainly. If you need full verification, put SNS behind an AWS-native ingest (API Gateway, Lambda) or verify with aws-sdk before handing the payload to handleWebhook.

Inbound email

Configure an SES receipt rule that publishes to SNS with the message content included. handleWebhook parses those into unified messages; delivery events are deliberately kept out of it.

Attachments and headers

SES's Simple content shape cannot carry attachments or custom headers, so the adapter automatically switches to raw MIME when you use either. That's transparent — you just set attachments: { enabled: true } or unsubscribe.

License

MIT