Skip to main content

Setup for Kotlin Multiplatform Application

Kotzilla SDK is directly available in Maven Central. You don't need anything to do apart using mavenCentral()

note

You need to have a Kotzilla account and having registered your application on the platform. See Signup Page

Gradle Setup

In your app module, add the plugin and Kotzilla SDK dependency to the build.gradle.kts file within the module directory: Module (app-level) Gradle file ( <project>/<app-module>/build.gradle.kts ):

Gradle Plugin & Dependencies

plugins {

// Kotzilla Gradle plugin
id("io.kotzilla.kotzilla-plugin") version "<version>" apply false
}

//...
commonMain.dependencies {
// The Kotzilla SDK library dependency
implementation("io.kotzilla:kotzilla-sdk:<version>")
}

Setup at Application start

In your Kotlin app, you need to activate the Kotzilla platform with following code

  • KotzillaCoreSDK - Run the Kotzilla SDK default instance
  • setup() - Setup Kotzilla platform with given App api Token and version name
  • attachKoinLogger() - Detect current Koin instance logger
  • connect() - Connect to Kotzilla platform

To start and connect the SDK, you can do as follow:

// Setup & connect Kotzilla SDK
val instance = KotzillaCoreSDK
.setup(" - ApiToken - ","1.0")
.attachKoinLogger()
.connect()

Start your Koin application with analyticsLogger, to activate analytics:

// Start Koin
startKoin {
analyticsLogger()
modules(...)
}