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

@iterativeflow/webhooks

v3.0.0

Published

Downloads

679

Readme

@iterativeflow/webhooks

Turn a signed provider webhook into a durable signal a parked flow can await. This is the inbound edge that lets a durable run pause on an external event — a /qa run comment, a preview deploy, a payment, a human approval — and resume crash-safe when it arrives.

Provider-agnostic: a pluggable verifier (with a github preset) plus a correlate callback that maps the event to the runs it should wake. Zero runtime dependencies beyond @iterativeflow/core — verification is Web Crypto HMAC (no node:crypto, no Buffer), so it runs on Node, Workers, and the edge.

import { webhookSignalBridge, github } from "@iterativeflow/webhooks";

const bridge = webhookSignalBridge(backend, {
  verify: github(process.env.GITHUB_WEBHOOK_SECRET!),
  // Map a verified event to the parked run(s) it concerns. `correlate` owns the app's
  // "PR 42 → runId" lookup — the bridge can't know it.
  correlate: async (event) => {
    if (event.type !== "issue_comment") return [];
    const pr = (event.payload as { issue: { number: number } }).issue.number;
    const runId = await findRunForPr(pr); // your state
    return runId ? [{ runId, name: "qa:approved", payload: event.payload }] : [];
  },
});

// In your HTTP handler — pass the RAW body (the bytes GitHub signed):
app.post("/webhooks/github", async (req) => {
  const result = await bridge({ body: await req.text(), headers: req.headers });
  return Response.json(result); // { type, id, deliveries: [{ runId, name, delivered }] }
});

The flow side is plain core — park on the signal, resume with its payload:

const qa = defineFlow({
  name: "qa",
  version: 1,
  run: async (ctx, input) => {
    const approval = await ctx.signal("qa:approved"); // parks until the webhook arrives
    return runQa(input, approval);
  },
});

Guarantees

  • Verify before trust. verify HMAC-checks the raw body (timing-safe) and rejects a forged or tampered request with a WebhookError before the store is touched. Any re-serialization of the body breaks the signature — pass the exact received bytes.
  • Idempotent delivery. Each signal is keyed by the provider's delivery id (${event.id}:${runId}:${name} by default), so a redelivery lands once. Delivery + run re-enqueue are atomic (durable via signalRun); the wakeup is a best-effort latency nudge.
  • Fan-out. One webhook can wake many runs — correlate returns an array, e.g. a PR synchronize superseding every in-flight run for that PR.

Providers

github(secret) ships built in. Any provider that signs the raw body with a hex HMAC in one header works via hmacVerifier({ secret, signatureHeader, idHeader, typeHeader, scheme?, hash? }). A provider with a different scheme (e.g. a timestamped or base64 signature) is a full WebhookVerifier function — add it as its own file (e.g. src/stripe.ts) next to github.ts and re-export from index.ts, so each preset stays independently importable and tree-shakes.