๐ณFREEIntermediate
STRIPE WEBHOOK HANDLER
Verified, idempotent, retry-safe Stripe webhooks in one file.
Single TypeScript file. Handles the four things people get wrong with Stripe webhooks: raw-body signature verification, idempotency (file-backed dedupe of seen event IDs, auto-pruned after 30 days), typed handler-map dispatch, and retry-aware status codes (200 on success/unhandled, 500 on handler error so Stripe retries). Swap the file-backed seen-store for Redis SETNX in production by editing two functions. Zero deps beyond stripe + express.