Stripe Setup
Configure Stripe for payments
Prerequisites
- Create a [Stripe account](https://stripe.com)
- Get your API keys from the Dashboard
Environment Variables
env
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."Create Products
In your Stripe Dashboard, create:
- **Products** - Your subscription plans
- **Prices** - Monthly/yearly pricing
Webhook Setup
Local Development
bash
stripe listen --forward-to localhost:3000/api/webhooks/stripeProduction
Add webhook endpoint in Stripe Dashboard: ``` https://yourdomain.com/api/webhooks/stripe ```
Events to listen for: - customer.subscription.created - customer.subscription.updated - customer.subscription.deleted - invoice.paid - invoice.payment_failed