Kotlin SDK for Aptabase

Instrument your apps with Aptabase, an Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps.


The SDK is available on Maven Central, so you can install it on your Android apps by adding the following to your build.gradle file:

dependencies {
    implementation 'com.aptabase:aptabase:0.0.5'


First you need to get your App Key from Aptabase, you can find it in the Instructions menu on the left side menu.

Initialized the SDK as early as possible in your app, for example:

import com.aptabase.Aptabase

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        // ...
        Aptabase.instance.initialize(this, "<YOUR_APP_KEY>"); // ? this is where you enter your App Key

Afterwards you can start tracking events with trackEvent:

import com.aptabase.Aptabase

// An event with no properties

// An event with a custom property
    mapOf<String, Any>(
        "name" to "here_comes_the_sun" 

A few important notes:

  1. The SDK will automatically enhance the event with some useful information, like the OS, the app version, and other things.
  2. You’re in control of what gets sent to Aptabase. This SDK does not automatically track any events, you need to call trackEvent manually.
    • Because of this, it’s generally recommended to at least track an event at startup
  3. The trackEvent function is a non-blocking operation as it runs on the background.
  4. Only strings and numbers values are allowed on custom properties


View Github