Skip to main content
This guide walks through connecting a payment provider, configuring a plan, and implementing checkout - creating the actual product/plan/price catalog is a dashboard task, not something your app’s code does at runtime.

Prerequisites

  • A Kerne app
  • A Stripe account
  • Your app already configured with authentication - see Authentication setup

1. Connect a payment provider

In the Kerne dashboard: Settings → Billing → Connect Stripe, then complete the OAuth flow. Use test mode during development.
Other providers may come sooner or later, and Stripe is the only one supported for now.

2. Create a product and plan

This is a dashboard action, not an SDK call - catalog configuration (products, plans, prices) is control-plane: it’s you configuring your own SaaS, not something your running app does. In the dashboard: Billing → Products → create a product → add a plan with pricing.

3. Display pricing

This section builds a pricing page from the raw data, to show what’s underneath. For a complete one already wired to checkout - plan cards, a price-label toggle - see <PricingTable> instead.
kerne.billing.plans() is the one catalog read exposed to your app - public, meant for a pricing page:
price.interval is {count}{unit} (unit is D, M, or Y - e.g. "1M", "3M", "1Y"), not a word - never render it directly to an end user. Written out by hand below; @kerne/react/ui exports the same formatInterval() (and formatMoney()) if you’re already pulling in that package:
Checkout takes a price id (plan.prices[i].id), not the plan’s own id - a plan can have several prices (monthly, yearly).

4. Implement checkout

5. Handle success

The subscription is created once the provider confirms payment (asynchronously - not necessarily the instant the browser lands back on your app after checkout):

6. Provide a billing portal

Next steps