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

@saacms/stripe-bridge

v0.1.9

Published

The reusable Stripe-webhook → saacms-Collection seam. Productionises the commerce-bridge spike's GO verdict (`docs/spikes/commerce-bridge.md`) as a host-mountable handler.

Readme

@saacms/stripe-bridge

The reusable Stripe-webhook → saacms-Collection seam. Productionises the commerce-bridge spike's GO verdict (docs/spikes/commerce-bridge.md) as a host-mountable handler.

  • Zero runtime deps beyond @saacms/core. No stripe SDK, no network. Signature verification is Web Crypto HMAC-SHA256 only.
  • Idempotency is ADR-0030 declarative unique — the target collection declares unique: [["stripeEventId"]]; a redelivered Stripe event.id yields a runtime 409, which this handler maps to a 200 ack (no duplicate row, no second afterChange). The spike's host-side filter-precheck workaround is superseded and not reproduced here.
  • Pure — the saacms runtime is injected as opts.fetch (the host passes app.fetch) and the clock as opts.now, so the handler is fully in-process testable.
import { createStripeWebhookHandler } from "@saacms/stripe-bridge"

const handler = createStripeWebhookHandler({
  fetch: app.fetch, // the saacms runtime
  collectionSlug: "orders",
  signingSecret: process.env.STRIPE_WEBHOOK_SECRET!,
  mapEvent: (event) =>
    event.type === "payment_intent.succeeded"
      ? { collection: "orders", body: buildOrder(event) }
      : null, // ignored event types → 200 ack, no write
})

// Mount at POST /api/stripe/webhook in any host (CF Worker, Next, Astro…).

HTTP status contract (the load-bearing idempotency invariant)

| Situation | Handler status | |---|---| | Signature missing/malformed/stale/mismatched | 400 (no write; Stripe must not retry) | | Validly signed but body not JSON / no string id+type | 400 (no write) | | mapEventnull (unhandled event type) | 200 ack (no write) | | Runtime create 2xx | 200 (created) | | Runtime create 409 (ADR-0030 redelivery) | 200 ack (duplicate — idempotent success) | | Any other runtime status (5xx / validation / …) | a 5xx (transient → Stripe retries) |