Stripe Zod Contracts

•
3
•

Defines type-safe Zod schemas and validation patterns for Stripe webhook handling and Fastify billing routes.

This skill enables developers to implement robust, type-safe billing systems by leveraging Zod as the single source of truth for Stripe integrations. It provides standardized patterns for Fastify type providers, discriminated unions for event dispatching, and secure environment configuration. By following these patterns, developers can ensure that webhook payloads and API requests are rigorously validated at runtime while maintaining full TypeScript type inference, reducing bugs in critical payment processing logic.

Key Features

01Reusable patterns for pagination, sparse updates, and data normalization
023 GitHub stars
03Standardized environment variable schemas for Stripe and server config
04Discriminated union patterns for type-safe Stripe event handling
05Fastify type provider setup for automatic Zod-to-TypeScript inference
06Secure webhook validation that preserves raw bodies for signature verification

Use Cases

01Implementing secure webhook endpoints with HMAC verification and Zod parsing
02Creating type-safe billing API routes for checkout and subscription management
03Building a subscription-based SaaS with Stripe and Fastify