Billing & plans
KolayLogin has two billing surfaces. One (workspace SaaS) is how we bill your developer workspace for using KolayLogin. The other (end-user subscriptions) is what your app charges its own users.
Copy this quickstart guide as a prompt for LLMs to implement KolayLogin in your application.
Enable billing first
End-user billing is off by default — plans, subscriptions, and revenue don't show up until you opt in. From your dashboard, open any app and click Billing, then press Enable Billing. See the dedicated Enable billing guide for the full flow.
Plans & features
After enabling billing, create plans (Free, Pro, Enterprise…) and attach Features to them. Features are the unit of gating in your app — each one is a short key like pro_export or advanced_analytics. Users with plans that carry that feature pass has({ feature: 'pro_export' }); users without it fail. See Features & gating.
import { Protect, Show } from '@kolaylogin/react';
<Protect feature="pro_export" fallback={<UpgradeCta />}>
<BulkExportButton />
</Protect>
<Show when={{ plan: 'gold' }} fallback={<BronzeOnlyNotice />}>
<GoldOnlyDashboard />
</Show>Workspace billing
Your workspace is on the Hobby plan by default. Upgrade from /app/settings/plan — the button kicks off a Stripe Checkout session. Once payment succeeds, a webhook flips the workspace plan, which in turn raises every entitlement cap (seats, MAUs, apps, webhooks, etc.) immediately.
- Monthly or annual billing; annual saves ~20 %.
- Plan changes prorate immediately (
proration_behavior: 'create_prorations'). - Cancel-at-period-end keeps access until the billing cycle ends.
- Failed payments open a 7-day grace window before we auto-downgrade to Hobby.
MAU metering
A Monthly Retained User (MRU) is a distinct end-user who had a session created during the month. A scheduler in the API snapshots counts every six hours and closes each month a day after it ends, pushing any overage as a one-off Stripe invoice item on your next recurring invoice.
- Hobby: 10K hard cap. New sign-ups past 10K get
403 mau. - Pro / Business / Enterprise: tiered overage pricing (see pricing).
End-user subscriptions
Sell inside your app by picking a payment gateway when you enable billing. We support three modes:
- Managed (shared test Stripe)— fastest start, great for local development. Uses our platform account so you don't need your own Stripe yet.
- Stripe Connect — link your own Stripe account. Payouts land in your bank; we charge a small application fee per transaction.
- Stripe platform (single-tenant) — for self-hosted deploys. You bring a
KL_STRIPE_SECRET_KEYdirectly.
Once live, drive users through POST /v1/billing/checkout. Use the React hook for a one-liner:
const { startCheckout, isLoading } = useCheckout();
<button disabled={isLoading} onClick={() => startCheckout(planId, 'monthly')}>
Upgrade
</button>Stripe webhook
Point Stripe to POST /v1/stripe/webhook with yourKL_STRIPE_WEBHOOK_SECRET. We verify signatures, dedup events via the stripe_webhook_events table, and route workspace subscriptions and end-user subscriptions to their own handlers.
automatic_tax: enabled and tax_id_collection: enabled. Stripe handles VAT / sales tax for your workspace's region automatically.