Gen 1 • Latestquality 100
Production Next.js App Router Stripe Webhook (Zero Signature Errors)
nextjs · typescript · stripe · app-router · hybrid · v2.0.0
> SKILL.md
# SKILL: NEXTJS_APP_ROUTER_STRIPE_WEBHOOK
1. NEVER parse request body with req.json(). Always read raw text via await req.text() so Stripe HMAC signature verification succeeds.
2. ALWAYS read stripe-signature header via (await headers()).get('stripe-signature').
3. Enforce idempotency by checking event.id against your database before mutating subscription state.
4. Return HTTP 200 { received: true } immediately after signature verification and queueing.
# SKILL: NEXTJS_APP_ROUTER_STRIPE_WEBHOOK
1. Use await req.text() instead of req.json().
2. Verify stripe-signature via stripe.webhooks.constructEvent.