Turn your network into a paid provider with your own Stripe account.

Billing with Stripe - node.you

A self-hosted network can charge for services through your own Stripe account. Billing is switched on by configuration alone: when Stripe credentials are present in the coordinator's .env, the Stripe endpoints mount and clients offer Checkout with Stripe; when they are absent, the network runs unmetered. Clients discover all of this from your server (/api/server/config), including your publishable key, so no client-side changes are involved.

What you set up in Stripe

  1. A Stripe account, naturally.

  2. A product with a recurring monthly price (this is the per-service price; subscriptions are quantity-based, so an account paying for three services holds one subscription with quantity 3). Note the price id (price_...).

  3. A webhook endpoint pointing at your coordinator: https://yourdomain.site/api/stripe/webhook, subscribed to these events:

    • checkout.session.completed
    • invoice.paid
    • customer.subscription.updated
    • customer.subscription.deleted

    Note the signing secret (whsec_...).

  4. Optionally, configure the Customer Portal in Stripe's settings; the app's Manage Billing button opens it for subscribers.

Coordinator configuration

Uncomment and fill the Stripe block in .env:

STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_PRICE_ID=price_...
SERVICE_PRICE_DISPLAY=$5/month

Restart the API (sudo systemctl restart nodeyou-api). That's the whole switch: /api/server/config now reports Stripe as a live provider.

SERVICE_PRICE_DISPLAY is the price tag shown on the app's launch cards. It is cosmetic only (billing charges whatever STRIPE_PRICE_ID says, so keep them in sync) and optional: leave it unset and the cards simply show no price.

Start with Stripe's test mode keys and a test webhook first; run a checkout with a test card end to end (checkout, profile provisions on invoice.paid/checkout.session.completed, deactivation adjusts the subscription) before switching the four values to live keys.

How it behaves

  • Users see Checkout with Stripe in the Launch dialog and pay through Stripe Checkout. The webhook provisions their profile when payment lands.
  • Adding a service to an existing subscription adjusts the quantity with proration; the app previews the exact charge before confirming.
  • Deactivating a service lowers the renewal quantity (or cancels the subscription on the last seat); nothing is refunded mid-cycle.
  • Billing-managed accounts can't also hold admin-granted allowances; the server refuses the mix so seat counts stay reconciled. Grants and Stripe can coexist on one network, just not on one account.

What about Google Play?

Play billing does not transfer to self-hosted networks and is not meant to: it is bound to the official app's Play Console listing, service account, and notification pipeline. Android users on your network use Stripe like everyone else (or allowances on an unmetered host). Leave the Google Play section of .env unset.

Appearance
Theme
—