Skip to main content

SDK setup for KMP apps

This guide shows the steps to set up the Kotzilla SDK in your KMP app.

Before starting, your application must be registered on the Kotzilla Platform:

Once your app is registered and the type is selected, follow the steps below to integrate the SDK, capture analytics, and start debugging and monitoring your app.

Step 1 - Setup Kotzilla SDK (KMP)

1.1 Kotzilla project configuration file

Download the kotzilla.json configuration file for your shared module and place it in the module directory:

Module (shared module) Gradle file: <project>/<shared module>`

This file contains your API key, version, and SDK configuration for shared code.

1.2 Set up the SDK

The instructions below use Version Catalog configuration by default.

If your project uses the traditional Gradle setup, please check the documentation here for specific instructions.

note

Kotzilla SDK is available on both Maven Central and the Kotzilla public repository. More information on how to configure access to the Kotzilla repository is available here

Add the following lines to your libs.versions.toml file:

[versions]
kotzilla = "1.4.0" // Check the latest version available below

[libraries]
kotzilla-sdk = { group = "io.kotzilla", name = "kotzilla-sdk", version.ref = "kotzilla" }

[plugins]
kotzilla = { id = "io.kotzilla.kotzilla-plugin", version.ref = "kotzilla" }
info

The latest version of the kotzilla-sdk is: Maven Central

Set up the Kotzilla Plugin in your project root-level Gradle file (<project>/build.gradle.kts):

plugins {
alias(libs.plugins.kotzilla) apply false
}

In your shared module Gradle file (<project>/<shared module>/build.gradle.kts), add:

plugins {
alias(libs.plugins.kotzilla)
}

commonMain.dependencies {
implementation(libs.kotzilla.sdk)
}

1.3 Sync Gradle

Sync your project in Android Studio or IntelliJ IDEA to apply the changes.

1.4 iOS Platform Support

The Kotzilla SDK supports iOS platforms in KMP projects.

iOS Build Configuration

Your shared module's build.gradle.kts should already include iOS targets:

kotlin {
// iOS targets
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "SharedModule" // Your shared module name
isStatic = true
}
}

// Other KMP targets
androidTarget()
// ... jvm, etc.
}

The Kotzilla SDK will automatically be included in your iOS framework when you build for iOS targets.

Xcode Integration

When integrating the shared KMP module into your Xcode project:

  1. The Kotzilla SDK is embedded in your shared framework
  2. No additional iOS-specific configuration is required
  3. Analytics data is automatically collected when the app runs on iOS

For framework generation, use Gradle tasks like:

Debug builds:

./gradlew linkDebugFrameworkIosSimulatorArm64
./gradlew linkDebugFrameworkIosArm64
./gradlew linkDebugFrameworkIosX64

Release builds:

./gradlew linkReleaseFrameworkIosSimulatorArm64
./gradlew linkReleaseFrameworkIosArm64
./gradlew linkReleaseFrameworkIosX64

Step 2 - Start Kotzilla SDK (KMP)

Initialize the Kotzilla SDK in your shared module Koin configuration (Koin.kt in commonMain) to capture analytics for multiplatform targets. The API key and app version are available inside the kotzilla.json file you downloaded in Step 1:

startKoin {
// Your current Koin configuration
..
// Add kotzilla analytics
analytics {
setApiKey("YourAPIKey") // from kotzilla.json
setVersion("AppVersion")
}
}

Step 3 - Go To Dashboard

Now that the SDK is configured, you can build and run your app to start capturing data from a first user session.

Once you've stopped the app:

  • Click Check your data to confirm everything is being collected correctly.
  • Then click Go to Dashboard to view your app’s performance and configuration insights.