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

@ingram-tech/newsletter

v0.4.4

Published

DEPRECATED — use @ingram-tech/nk-marketing. Supabase-backed newsletter subscriptions + sending, with RFC 8058 one-click unsubscribe.

Downloads

1,120

Readme

@ingram-tech/newsletter

[!WARNING] Deprecated — use @ingram-tech/nk-marketing. This package is Supabase-bound; nk-marketing is its Postgres/nk-db-native successor and covers the same newsletter flow (subscribe, sendBroadcast) plus contacts/consent and triggered lifecycle campaigns. As the fleet finishes the Supabase→Postgres move (see docs/philosophy.md), migrate to nk-marketing. Still published and supported for sites on Supabase, but gets no new features.

Supabase-backed newsletter subscriptions and sending, with idempotent subscribe/resubscribe, token-based unsubscribe, and RFC 8058 one-click unsubscribe. Sends via @ingram-tech/nk-email (whose escapeHtml

  • buildListUnsubscribeHeaders it now reuses rather than duplicating).

This package owns its tables and ships the migrations; you inject a Supabase client and a base URL. It defines its own row types (it does not import your generated Database), so it drops into any Supabase project.

Install

bun add @ingram-tech/newsletter @supabase/supabase-js

1. Apply the schema

Copy the migrations into your supabase/migrations (they live in the package):

cp node_modules/@ingram-tech/newsletter/migrations/0001_newsletters.sql \
   supabase/migrations/$(date +%Y%m%d%H%M%S)_newsletters.sql

0001_newsletters.sql creates newsletters + newsletter_subscriptions (UUID keys, RLS, indexes). Apply 0002_newsletters_auth_link.sql only if your site has user signups and you want pre-signup subscriptions back-linked to users.

Then seed a newsletter row (slug, name, from_name, from_local_part).

2. Use it

import { createNewsletter } from "@ingram-tech/newsletter";
import { createClient } from "@supabase/supabase-js";

const newsletter = createNewsletter({
	supabase: createClient(url, serviceRoleKey), // service-role: writes bypass RLS
	baseUrl: "https://example.com",
});

// Subscribe (idempotent) — e.g. in POST /api/newsletter/subscribe
await newsletter.subscribe({ newsletterSlug: "product-updates", email });

// Unsubscribe — e.g. in your /api/newsletter/unsubscribe route
await newsletter.unsubscribe(token);

// Send to all active subscribers (per-recipient one-click unsubscribe)
const result = await newsletter.send({
	newsletterSlug: "product-updates",
	subject: "What's new",
	content: "First line.\n\nSecond paragraph.",
	cta: { label: "Read more", href: "https://example.com/post" },
	// onlyTo: ["[email protected]"], // for a test send
});

Requires @ingram-tech/nk-email's env (CLOUDFLARE_*, EMAIL_FROM_DOMAIN). The sending address is <from_local_part>@<EMAIL_FROM_DOMAIN>.

Rendering

The built-in renderer produces a clean, dependency-free HTML + text email. Override it with createNewsletter({ render }) to use your own template (e.g. React Email).

Not included (by design)

Open/click tracking and "view in browser" are a separate concern (a future email-tracking package) — this package focuses on subscriptions + delivery.