Payments & Billing
Ignitra includes a complete Stripe integration with subscriptions, one-time payments, and usage-based billing.
Setup
- Create a Stripe account at stripe.com
- Get your API keys from the Stripe Dashboard
- Add keys to your
.envfile (see below)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...Creating Products
In the Stripe Dashboard, create products matching your plans:
- Free (no Stripe product needed)
- Starter ($X/month)
- Pro ($X/month)
- Enterprise ($X/month or custom)
Copy each product's Price ID into src/config/plans.ts.
Webhook Setup
Stripe webhooks notify your app when payments succeed, subscriptions change, etc.
For local development:
stripe listen --forward-to localhost:3000/api/webhooks/stripeFor production:
- Stripe Dashboard → Developers → Webhooks
- Add endpoint:
https://yourdomain.com/api/webhooks/stripe - Select events:
checkout.session.completed,customer.subscription.updated,customer.subscription.deleted,invoice.payment_succeeded - Copy the webhook signing secret to
STRIPE_WEBHOOK_SECRET
Usage-Based Billing
For metered billing (charge per API usage):
- Create a metered price in Stripe
- Configure in
src/config/plans.ts - The token tracking system automatically reports usage to Stripe