Payments with Stripe
Stripe is optional. When configured, signed-in users can purchase Lifetime Premium as a one-time $9.00 USD payment via Stripe Checkout (unlocking 300 monthly AI captures, Advanced Reports & PDF export, and Premium duplicate/optimization API analytics).Required variables
SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, and SUPABASE_SECRET_KEY, plus migrations through 20260927012800_payment_lifecycle.sql).
Payment Functions
create-checkout-session.ts: Creates a one-time Stripe Checkout session. When Supabase is enabled, it verifies the user’s access token and derives user identity, email, and the trustedSTRIPE_PRICE_IDentirely on the server (never trusting client-supplied Price IDs). Also enforcesSTRIPE_MODEandPRODUCTION_SUPABASE_URLsafety guards.checkout-status.ts: Verifies Checkout session status directly against Stripe when the user returns to/app, supporting both instant card payments and asynchronous payment methods without trusting redirect query parameters alone.stripe-webhook.ts: Verifies the Stripe signature, key/eventlivemodematch, payment status, andSTRIPE_PRICE_ID, then runs idempotent database reconciliation to grant or revoke Premium across completions, refunds, and disputes. Guest support donations remain supported on self-hosted instances without Supabase (without granting Premium).
Stripe Dashboard setup
- Create a Stripe Product (for example
SteadyRenew Lifetime Premium). - Create a one-time Price of $9.00 USD (do not reuse legacy $6 Prices).
- Set
STRIPE_PRICE_ID=price_...in your server environment. - Create a webhook endpoint pointing to:
- Subscribe the webhook endpoint to all 11 lifecycle events handled by
stripe-webhook.ts:- Checkout fulfillment:
checkout.session.completed,checkout.session.async_payment_succeeded - Refunds:
charge.refunded,refund.created,refund.updated,refund.failed - Disputes:
charge.dispute.created,charge.dispute.updated,charge.dispute.closed,charge.dispute.funds_withdrawn,charge.dispute.funds_reinstated
- Checkout fulfillment:
- Save the signing secret in
STRIPE_WEBHOOK_SECRET.
Relationship to API & MCP limits
Developer API key limits (5 active keys) and request rate limits (60 requests/minute) are identical on Free and Premium plans. Lifetime Premium unlocks the two higher-order analytics endpoints (/api/v1/analytics/duplicates and /api/v1/analytics/optimizations) alongside web Advanced Reports, PDF export, and 300 monthly AI captures.
Local webhook testing
Forward events with the Stripe CLI while runningnpm run dev:full: