next-forgenext-forge
Mask

Payments

In-app payments and webhooks with Stripe.

next-forge uses Stripe by default for payments and billing. Implementing Stripe in your project is straightforward.

In-App Purchases

You can use Stripe anywhere in your app by importing the stripe object like so:

page.tsx
import { stripe } from '@repo/design-system/lib/stripe'; 
 
// ...
 
await stripe.prices.list(); 

Webhooks

Stripe webhooks are handled in the POST /webhooks/stripe route in the api app. This route constructs the event and then switches on the event type to determine how to process the event.

Local Development

To test webhooks locally, we've configured the Stripe CLI to forward webhooks to your local server. This will start automatically when you run pnpm dev.

On this page