Docs

Install on Android

A Kotlin library with a Jetpack Compose chat screen.

Quickest way: one command

npx @octokan/cli init app_xxxxxxxxxxxx https://YOUR-BACKEND

Run it from your project's folder (it needs Node.js). It adds the dependency and the JitPack repository to Gradle, and calls Octokan.configure from your Application class (creating and registering one if you have none). Your app key and backend URL are on the Install page of the dashboard. The manual steps below are exactly what it does.

The SDK supports Android 7.0 (API 24) and up and uses Jetpack Compose. It lives in sdks/android of the octokan repository.

1. Add the module

// settings.gradle.kts
include(":octokan-sdk")
project(":octokan-sdk").projectDir = file("path/to/Octokan/sdks/android")

// app/build.gradle.kts
implementation(project(":octokan-sdk"))

2. Configure once

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Octokan.configure(this, appId = "app_xxxxxxxxxxxx", baseUrl = "https://YOUR-BACKEND")
    }
}

Nothing is sent or stored until the person opens the chat.

3. Show the chat

// full screen from anywhere
Octokan.open(context)

// or embed it in Compose
OctokanChat(onClose = { navController.popBackStack() })

Know who's writing

Octokan.identify(id = user.id, email = user.email, name = user.name)

// on sign-out
Octokan.reset()

Messages queue on the device while offline and send automatically. Replies appear within a few seconds while the chat is open.

Privacy

The SDK stores one random token (and any unsent messages) in private SharedPreferences. Octokan.deleteMyData() erases the person's chat from octokan and the device.

NextIonic and Capacitor→