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

webhookshield

v1.0.2

Published

Unified, zero-dependency, edge-compatible webhook signature verification library for Node.js and TypeScript. Supports Stripe, GitHub, Clerk, Shopify, Lemon Squeezy, and Resend.

Downloads

478

Readme

🛡️ webhookshield

NPM Version Downloads Build Status License GitHub Stars

Unified, zero-dependency, edge-compatible webhook signature verification library for Node.js and TypeScript.

webhookshield is a lightweight security utility that provides a single, unified API to verify webhook signatures across popular SaaS platforms. By using native runtime cryptography, it eliminates the need to install heavy official SDKs (like @stripe/stripe-js or @clerk/backend), resulting in a smaller bundle size and zero external dependencies.


Key Features

  • ⚡ Sub-10ms Edge Execution: Zero dependencies and fully optimized for Edge runtimes (Cloudflare Workers, Vercel Edge, Bun, Lagon) as well as traditional Node.js.
  • 🔒 Hardened Security: Utilizes cryptographic constant-time comparison algorithms (crypto.timingSafeEqual) to completely block timing attacks.
  • 🛠️ Multi-Provider Support: Verify signatures for Stripe, GitHub, Clerk, Resend, Shopify, and Lemon Squeezy in one library.
  • 📦 Native TypeScript Support: Prepackaged with type definitions (index.d.ts) for developer autocompletion.
  • ⏳ Replay Attack Guards: Automated timestamp drift verification checks (with customizable tolerances).

Supported Providers

| Provider | Signature Format | Header Key | Replay Protection | | :--- | :--- | :--- | :--- | | Stripe | HMAC-SHA256 (Hex) | stripe-signature | ✅ Yes (5m Tolerance) | | GitHub | HMAC-SHA256 (Hex) | x-hub-signature-256 | ❌ No | | Clerk / Svix | HMAC-SHA256 (Base64) | svix-signature | ✅ Yes (5m Tolerance) | | Resend | HMAC-SHA256 (Base64) | svix-signature | ✅ Yes (5m Tolerance) | | Shopify | HMAC-SHA256 (Base64) | x-shopify-hmac-sha256 | ❌ No | | Lemon Squeezy | HMAC-SHA256 (Hex) | x-signature | ❌ No |


Installation

Install via your preferred package manager:

npm install webhookshield
# or
yarn add webhookshield
# or
pnpm add webhookshield
# or
bun add webhookshield

Quick Start Examples

1. Stripe Webhooks

const { verify } = require('webhookshield');

const isValid = verify('stripe', {
  payload: req.rawBody, // Must be the raw request string
  signature: req.headers['stripe-signature'],
  secret: process.env.STRIPE_WEBHOOK_SECRET
});

if (!isValid) {
  return res.status(400).send('Webhook signature verification failed');
}

2. Clerk (Svix) Webhooks

const { verify } = require('webhookshield');

const isValid = verify('clerk', {
  payload: req.rawBody,
  signature: req.headers['svix-signature'],
  secret: process.env.CLERK_WEBHOOK_SECRET,
  svixId: req.headers['svix-id'],
  svixTimestamp: req.headers['svix-timestamp']
});

3. GitHub Webhooks

const { verify } = require('webhookshield');

const isValid = verify('github', {
  payload: req.rawBody,
  signature: req.headers['x-hub-signature-256'],
  secret: process.env.GITHUB_WEBHOOK_SECRET
});

Contributing

We welcome community contributions! If you want to add signature support for a new provider:

  1. Fork and clone the repository: git clone https://github.com/Ezeko/webhookshield.git
  2. Add your provider logic in src/providers.js
  3. Write automated unit assertions in tests/index.test.js
  4. Run tests locally: npm test

Please read our Contributing Guide to understand linting rules and PR submission procedures.


License

MIT © Ezekiel Adejobi