SDK

Kotlin SDK

Unified SDK for Android and JVM — one dependency covers features, paywall, auth, and monitor.

Install

// build.gradle.kts (mavenCentral() is standard): implementation("tools.onelo:onelo-kotlin:1.+")

Initialize

import io.onelo.Onelo

// Initialize once (e.g. in Application or ViewModel)
val onelo = Onelo(publishableKey = "onelo_pk_live_YOUR_KEY")

// Identify the user — must be called before using any module (use a coroutine)
lifecycleScope.launch {
    onelo.identify(userId = userId)

Usage

    // Features
    val isEnabled = onelo.features.isEnabled("export-button")     // → Boolean
    val status    = onelo.features.status("export-button")        // → "enabled" | "greyed" | "hidden" | "upsell"

    // Gating — Features SDK resolves against the user's REAL plan (server-side)
    if (!onelo.features.isEnabled("export-button")) {
        // blocked → render status (greyed / upsell); onelo.openUpgrade(...) to upgrade
    }
}

From mavenCentral() — build.gradle.kts: implementation("tools.onelo:onelo-kotlin:1.+")

Your publishable key

Replace onelo_pk_live_YOUR_KEY with your key from the dashboard → SDK tab.

Kotlin SDK — Onelo Docs