Skip to main content

Billing

Recurfy can integrate Stripe for subscriptions. The API exposes internal billing routes; Cloud Functions expose callable functions that the dashboard uses to start Checkout or open the Customer Portal.

Configuration

On the API, set:

VariablePurpose
STRIPE_SECRET_KEYEnables Stripe client and marks billing as “configured”.
STRIPE_WEBHOOK_SECRETVerifies Stripe-Signature on POST /webhooks/stripe.

On the web app (Vite), set:

VariablePurpose
VITE_STRIPE_PUBLISHABLE_KEYStripe.js / Elements if used.
VITE_STRIPE_PRICE_PROPrice ID for the Upgrade to Pro checkout button.

If STRIPE_SECRET_KEY is empty, the dashboard shows billing as not configured and disables checkout actions.

Local webhooks

Forward Stripe events to your local API:

stripe listen --forward-to localhost:4000/webhooks/stripe

The CLI prints a whsec_... signing secret — put it in STRIPE_WEBHOOK_SECRET and restart the API.

Production

Use Stripe’s dashboard to configure products/prices, webhook endpoints pointing at your deployed API, and live keys only in secure environments.