Quick Start — Cloud Dashboard

Add subscription billing to your KMP app in under 15 minutes.

1. Create your app on PayCraft

  1. Sign up at paycraft.mobilebytesensei.com/auth/login (free — no card required).
  2. Follow the onboarding wizard: name your app, connect a payment provider, create your first product.
  3. Copy your API key from Settings → API Keys.

2. Add the dependency

// build.gradle.kts (module)
implementation("io.github.mobilebytelabs:cmp-paycraft:2.0.0")

3. Initialize at app startup

// Application.kt / MainActivity.kt / AppDelegate
PayCraft.initialize(apiKey = "pk_live_YOUR_KEY_HERE")

That's all the code you need. Products, pricing, paywall template, and branding are configured in the dashboard.

4. Show the paywall

@Composable
fun App() {
    // Show when the user taps "Upgrade" or hits a paywall gate
    PayCraftPaywall()
}

5. Check subscription status

val billingManager = PayCraft.billingManager
val state: BillingState = billingManager.billingState.collectAsState().value

when (state) {
    is BillingState.Free    -> { /* show upgrade prompt */ }
    is BillingState.Premium -> { /* unlock premium features */ }
    is BillingState.Loading -> { /* show shimmer */ }
}

Self-hosted Enterprise

If you're running your own Supabase backend:

PayCraft.initialize(
    apiKey  = "pk_live_YOUR_KEY_HERE",
    backend = PayCraftBackend.SelfHosted(
        supabaseUrl     = "https://billing.yourcompany.com",
        supabaseAnonKey = "eyJ...",
    )
)

See the self-hosting guide for full setup instructions including Docker Compose and Helm chart.

Sample app

A minimal working app is at github.com/MobileByteLabs/paycraft-sample-cloud. Clone it, paste your API key, run.

Next steps