Documentation

Payments & Billing

Ignitra includes a complete Stripe integration with subscriptions, one-time payments, and usage-based billing.

Setup

  1. Create a Stripe account at stripe.com
  2. Get your API keys from the Stripe Dashboard
  3. Add keys to your .env file (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/stripe

For production:

  1. Stripe Dashboard → Developers → Webhooks
  2. Add endpoint: https://yourdomain.com/api/webhooks/stripe
  3. Select events: checkout.session.completed, customer.subscription.updated, customer.subscription.deleted, invoice.payment_succeeded
  4. Copy the webhook signing secret to STRIPE_WEBHOOK_SECRET

Usage-Based Billing

For metered billing (charge per API usage):

  1. Create a metered price in Stripe
  2. Configure in src/config/plans.ts
  3. The token tracking system automatically reports usage to Stripe
Payments & Billing | Ignitra Docs