Apext

SDK

Kotlin / Android

Native Android SDK with auto screen tracking, breadcrumbs, and crash capture.

01.Add the dependency

kotlin
dependencies {
  implementation("dev.apext:orbit-sdk-kotlin:1.0.0")
}

02.Initialize in Application class

kotlin
class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        OrbitSdkAnalytics.init(
            this,
            config = OrbitSdkConfig(
                apiKey = "orbit_sdk_live_...",
                baseUrl = "https://apext.dev/orbit",
                serviceName = "my-android-app",
                enableAutoScreenTracking = true,
                enableCrashTracking = true,
            )
        )
    }
}

03.Track an event

kotlin
OrbitSdkAnalytics.client.track(
    OrbitSdkEvent(
        eventName = "user_signed_up",
        userId = "user_123",
        eventProperties = mapOf("plan" to "pro"),
    )
)

04.Automatic crash capture

kotlin
// The AutoTracker installs a Thread.setDefaultUncaughtExceptionHandler
// when enableCrashTracking = true (default). Uncaught exceptions are
// automatically sent with stack trace and thread context.
//
// No manual setup needed. Chained with any existing handler.