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:
| Variable | Purpose |
|---|---|
STRIPE_SECRET_KEY | Enables Stripe client and marks billing as “configured”. |
STRIPE_WEBHOOK_SECRET | Verifies Stripe-Signature on POST /webhooks/stripe. |
On the web app (Vite), set:
| Variable | Purpose |
|---|---|
VITE_STRIPE_PUBLISHABLE_KEY | Stripe.js / Elements if used. |
VITE_STRIPE_PRICE_PRO | Price 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.