Menu

Post image 1
Post image 2
1 / 2
0

I open-sourced the Stripe webhook verifier I built for Next.js 15

DEV Community·Build Wright·27 days ago
#5eX3HzqA
Reading 0:00
15s threshold

The problem I shipped my first SaaS a few weeks ago. Stripe webhooks were one of the things that took longer than they should have, because the official Stripe documentation example breaks in Next.js 15 App Router. The issue is how App Router reads request bodies: The standard pattern in older Next.js used req.body directly. App Router uses request.text() and the body can only be consumed once, which trips up the standard Stripe verification flow if you read the body for any reason before passing it to the verifier. I solved it for myself, then realized other people were probably hitting the same wall. So I extracted what I built into a standalone package. What it is @northvane/stripe-webhook-verifier-nextjs A type-safe Stripe webhook signature verifier for Next.js 15 App Router, with structured failure reasons so you can tell the difference between "wrong signature" and "expired timestamp" and "malformed header" without parsing error strings.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More