Multi-Provider Webhook Debugger

Compute and verify raw-body HMAC-SHA256 webhook signatures locally in your browser using Web Crypto API, with drop-in edge-compatible verification code.

100% Browser Web Crypto HMAC-SHA256 Debugger (Stripe)

Header: stripe-signature • Zero secrets leave your tab

Drop-In Stripe Raw-Body Verification Template

// app/api/webhooks/stripe/route.ts (Next.js App Router / Cloudflare Workers)
import Stripe from 'stripe';

export async function POST(req: Request) {
  const rawBody = await req.text(); // CRITICAL: NEVER call req.json() before verifying!
  const sig = req.headers.get('stripe-signature');
  if (!sig) return new Response('Missing signature', { status: 400 });

  const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
  const event = stripe.webhooks.constructEvent(rawBody, sig, process.env.STRIPE_WEBHOOK_SECRET!);
  return Response.json({ received: true, type: event.type });
}