Skip to main content

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

For Lifetime Premium entitlement storage, Supabase must also be configured (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 trusted STRIPE_PRICE_ID entirely on the server (never trusting client-supplied Price IDs). Also enforces STRIPE_MODE and PRODUCTION_SUPABASE_URL safety 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/event livemode match, payment status, and STRIPE_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

  1. Create a Stripe Product (for example SteadyRenew Lifetime Premium).
  2. Create a one-time Price of $9.00 USD (do not reuse legacy $6 Prices).
  3. Set STRIPE_PRICE_ID=price_... in your server environment.
  4. Create a webhook endpoint pointing to:
  1. 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
  2. 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 running npm run dev:full: