npx skills add ...
npx skills add vercel-labs/emulate --skill stripe
Emulated Stripe API for local development and testing. Use when the user needs to process payments locally, test checkout flows, create customers, manage products and prices, handle payment intents, work with webhooks, or use the Stripe SDK without hitting real Stripe servers. Triggers include "Stripe API", "emulate Stripe", "test payments locally", "checkout flow", "payment intent", "Stripe webhook", "Stripe SDK", "STRIPE_API_KEY", or any task requiring a local Stripe API.
npx skills add vercel-labs/emulate --skill stripe
Fully stateful Stripe API emulation. Customers, products, prices, checkout sessions, payment intents, charges, and payment methods persist in memory. Webhooks fire on state changes. The hosted checkout UI lets you complete payments in the browser.
No real payments are processed. Every Stripe SDK call hits the emulator and produces realistic responses.
Or programmatically:
The Stripe Node.js SDK does not read an environment variable for the base URL. You must pass it when constructing the client:
When using @emulators/adapter-next, the emulator runs inside your Next.js app at /emulate/stripe. The SDK needs to point at localhost with a proxy route to forward /v1/* calls to /emulate/stripe/v1/*:
Seed data is optional. All entities support an optional id field for deterministic IDs that survive server restarts.
The product_name field in prices links to the product by name. Use events: ['*'] to receive all webhook events, or specify individual event types.
The session's url field points to a hosted checkout page at /checkout/cs_xxx. Clicking "Pay" on that page completes the session, fires the checkout.session.completed webhook, and redirects to success_url. The {CHECKOUT_SESSION_ID} template in success_url is replaced with the actual session ID.
Charges are created automatically when a payment intent is confirmed.
The emulator dispatches webhook events when state changes. Register webhooks via seed config or programmatically.
Webhooks configured with a secret include Stripe-Signature: t=<timestamp>,v1=<signature>. The signature is an HMAC SHA-256 over <timestamp>.<raw body>.
| Event | Trigger |
|---|---|
customer.created | Customer created |
customer.updated | Customer updated |
customer.deleted | Customer deleted |
product.created | Product created |
price.created | Price created |
payment_intent.created | Payment intent created |
payment_intent.succeeded | Payment intent confirmed |
payment_intent.canceled | Payment intent canceled |
charge.succeeded | Payment intent confirmed (charge auto-created) |
checkout.session.completed | Checkout completed via hosted page |
checkout.session.expired | Checkout session expired |