stripe-webhook-validation

Verify Stripe webhook signatures using raw request bodies in Express or NestJS.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/javicasper/memory-forge --skill stripe-webhook-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stripe-webhook-validation
Source: https://github.com/javicasper/memory-forge/tree/main/examples/monorepo/apps/payments/.claude/skills/stripe-webhook-validation
Command: npx skills add https://github.com/javicasper/memory-forge --skill stripe-webhook-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Stripe webhook signature verification can fail when the request body is parsed before verification, causing 400 errors and missed events.

Core Features & Use Cases

  • Raw body verification: Use Stripe's constructEvent with the raw request body to verify signatures.
  • Express/NestJS compatibility: Provides patterns for Express and NestJS to safely handle webhooks in the payments context.
  • Error handling: Graceful handling of signature mismatches and helpful logging to diagnose issues.

Quick Start

Configure your Stripe webhook endpoint to use the raw body for signature verification and test with a live webhook.

Frequently Asked Questions about stripe-webhook-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does Stripe webhook signature validation fail in my Node.js app?

Stripe webhook signature validation fails when the Express or NestJS body parser modifies the payload before verification. You must pass the raw request body to stripe.webhooks.constructEvent to correctly verify signatures and prevent 400 errors.

How do I configure raw body parsing for Stripe webhooks in Express?

To configure raw body parsing for Stripe webhooks in Express, use the express.raw middleware specifically for your webhook endpoint. This ensures the original request body is preserved for stripe.webhooks.constructEvent signature verification.

Can I use this Stripe webhook validation pattern with NestJS?

Yes, this Stripe webhook validation pattern supports NestJS. It provides specific implementation patterns to safely capture the raw request body in NestJS, ensuring correct signature verification and secure error handling for missed events.

What is the best way to handle Stripe webhook signature mismatch errors?

The best way to handle Stripe webhook signature mismatch errors is to implement graceful error handling with helpful logging. This approach diagnoses signature verification failures securely without exposing sensitive endpoint details to the client.

Do I need to disable body parsing globally to verify Stripe webhook signatures?

No, you do not need to disable body parsing globally to verify Stripe webhook signatures. You can selectively apply raw body parsing middleware to the specific webhook endpoint in Express or NestJS while keeping JSON parsing for other routes.