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

@portablecore/email-broadcasts

v0.3.0

Published

Shared email-broadcast (Mailshrimp parity) primitives for Portable platforms

Readme

@portablecore/email-broadcasts

Shared email-broadcast (Mailshrimp parity) primitives for Portable platforms. Consumed by Portable Expert and Portable Team.

What's here

Per Lisagor's day-one extraction call (consult thread pep_1777165952764):

  • Pure helper functionsgenerateUnsubscribeToken, verifyUnsubscribeToken, getUnsubscribeUrl, isEmailUnsubscribed, recordUnsubscribe, updateCampaignStats.
  • Send-batch orchestratororchestrateBatchSend (stub today; lands with the first port of Expert's send pipeline).
  • Audience resolutionresolveAudienceMembers (stub today).
  • HTML render / Postmark handoffrenderCampaignEmail (stub today).
  • Schema-shape typesEmailCampaign, EmailCampaignRecipient, EmailAudienceGroup, EmailUnsubscribe, AudienceMember, etc.

What stays per-platform

  • Schema migrations and RLS policies. Tables are convergent in shape but Team carries an extra workspace_profile_id FK. Both platforms own their migration files.
  • API route handlers (apps/web/app/api/...).
  • Admin UI components.
  • The unsubscribe salt itself — each platform sets UNSUBSCRIBE_TOKEN_SALT in its environment and passes the value into the token helpers as a parameter.

Usage

import {
  generateUnsubscribeToken,
  verifyUnsubscribeToken,
  getUnsubscribeUrl,
  isEmailUnsubscribed,
} from "@portablecore/email-broadcasts";

// Generate the link that goes in the email footer:
const url = getUnsubscribeUrl(
  "[email protected]",
  process.env.UNSUBSCRIBE_TOKEN_SALT!,
  process.env.NEXT_PUBLIC_APP_URL!,
);

// Verify a click on the unsubscribe link:
const ok = verifyUnsubscribeToken(
  email,
  token,
  process.env.UNSUBSCRIBE_TOKEN_SALT!,
);

Token scheme

The current scheme is sha256(email + salt). This is byte-for-byte compatible with Portable Expert's existing tokens-in-the-wild (see apps/web/lib/email/campaign.ts and apps/web/app/api/unsubscribe in the Expert repo).

It's not HMAC. A future hardening pass should migrate both platforms to HMAC together. Until then, the salt is the secret — keep it out of client bundles and out of public repos.

Status

This package is currently scaffolded. The token helpers (tokens.ts) and recipient/stats helpers (recipients.ts, stats.ts) are implemented. The send-pipeline pieces (orchestrator.ts, audience.ts, rendering.ts) are stubs that will be filled in when Workstream A's port of Expert's lib/email/campaign.ts

  • lib/email/send.ts lands.

See docs/handoffs/JOSE_TOOLSET_REPLACEMENT.md §3 for the broader work plan.