> For the complete documentation index, see [llms.txt](https://docs.luciq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.luciq.ai/kmp/setup-luciq-for-kmp/integrating-luciq.md).

# Integrate Luciq on KMP

## Get started in seconds

### Option 1 — Set up with an AI coding agent (recommended)

In your AI editor, paste:

```
Set up Luciq SDK in this project in one shot!
1. Install the Luciq agent skills: `npx luciq-skills install`
2. Setup and authenticate Luciq MCP server to this project
3. Add the Luciq SDK to this project
```

Check the [skills](https://docs.luciq.ai/product-guides-and-integrations/product-guides/ai-features/agent-skills) and [MCP](https://docs.luciq.ai/product-guides-and-integrations/product-guides/ai-features/luciq-mcp-server) docs for more details.

### Option 2 — Install manually

This installation process adds the Luciq KMP library that supports [Bug Reporting](https://www.luciq.ai/product/bug-reporting), [Crash Reporting](https://www.luciq.ai/product/crash-reporting), and [App Performance Monitoring](https://www.luciq.ai/product/app-performance-monitoring) from shared Kotlin code.

{% stepper %}
{% step %}

#### Add the dependency

<details>

<summary>Automatic Approach (Luciq KMP Gradle Plugin)</summary>

The Luciq KMP Gradle plugin handles all platform-specific dependency wiring automatically for Kotlin Multiplatform projects.<br>

To install the Kotlin Multiplatform SDK, you need to add the following to your `build.gradle.kts` file in your shared module:<br>

{% code title="shared/build.gradle.kts" overflow="wrap" %}

```kts
plugins {                                                                                                                                                                
      id("ai.luciq.kmp") version "0.0.9"                                                                                                                                  
  }

```

{% endcode %}

{% hint style="info" %}
**The plugin automatically:**

* Adds the ai.luciq.library:luciq-kmp dependency to commonMain.
* Exports Luciq KMP types from iOS framework binaries so they are visible in Swift/ObjC.
* Configures the iOS native SDK via one of two paths:
  * CocoaPods: If the Kotlin CocoaPods plugin is applied, it adds pod("Luciq") with the correct version and compiler options.
  * Swift Package Manager (SPM): it applies linker flags automatically.
    {% endhint %}

**iOS**

In your iOS App project add [LuciqKMP](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios) dependency. See our iOS integration guide for instructions.[Luciq iOS SDK](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios)

</details>

<details>

<summary>Manual Approach</summary>

**Gradle (Android & shared code)**

In your Kotlin Multiplatform module, add the library to `commonMain` so it is available on all targets. The same artifact resolves to the correct variant for each platform:

{% code title="Kotlin (build.gradle.kts)" %}

```kotlin
    sourceSets {
        commonMain.dependencies {
            api("ai.luciq-library:luciq-kmp:x.x.x")
        }
}
```

{% endcode %}

Use the latest version from [Maven Central](https://central.sonatype.com/artifact/ai.luciq.library/luciq-kmp)

**iOS**

In your iOS App project add [LuciqKMP](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios) dependency. See our iOS integration guide for instructions.[Luciq iOS SDK](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios)

Each Luciq KMP release pins a specific native **Luciq** SDK / `LuciqSDK` pod version. Use the table below to match the Luciq KMP version with the required pod version:

| Luciq KMP Version | Required Luciq Pod Version |
| ----------------- | -------------------------- |
| 0.0.9             | 19.7.0                     |
| 0.0.8             | 19.5.0                     |
| 0.0.7             | 19.5.0                     |
| 0.0.6             | 19.5.0                     |
| 0.0.5             | 19.5.0                     |
| 0.0.4             | 19.5.0                     |
| 0.0.2             | 19.3.0                     |

</details>
{% endstep %}

{% step %}

### Initialize the SDK

#### Import Luciq in your code

We recommend placing your Luciq configuration code in a shared module and invoking it from the platform-specific initialization logic within each of your Kotlin Multiplatform applications.

In your `commonMain` Kotlin code:

{% code title="Kotlin (Shared.kt)" %}

```kotlin
import ai.luciq.kmp.modules.LuciqKmp
import ai.luciq.kmp.utils.InvocationEvents

object LuciqDefaults {
    const val APP_TOKEN = "APP_TOKEN"
    val invocationEvents = listOf(InvocationEvents.FloatingButton)
    val logLevel = LogLevel.Debug
   val appVariant:String? = null
}

fun initializeLuciq(configuration: LuciqConfiguration) {
   LuciqKmp.init(configuration)
}
```

{% endcode %}

**Android**

You need an `Application` instance and at least one invocation event:

{% code title="Kotlin" %}

```kotlin
val configuration = LuciqConfiguration(
    androidApplication = application,
    token = LuciqDefaults.APP_TOKEN,
    invocationEvents = LuciqDefaults.invocationEvents,
    logLevel = LuciqDefaults.logLevel,
    appVariant = LuciqDefaults.appVariant
)
Shared.initializeLuciq(configuration)
```

{% endcode %}

**iOS**

On iOS, `LuciqConfiguration` does not take an application parameter:

{% code title="App.swift" %}

```swift
val configuration = LuciqConfiguration(
   token: LuciqDefaults.shared.APP_TOKEN,
    invocationEvents: LuciqDefaults.shared.invocationEvents,
    logLevel: LuciqDefaults.shared.logLevel,
    appVariant: LuciqDefaults.shared.appVariant
)
Shared.initializeLuciq(configuration)
```

{% endcode %}

Replace `APP_TOKEN` with your application token from the [Luciq dashboard](https://dashboard.luciq.ai/dashboard/) (**Settings** → **SDK Integration**).

Initialize the SDK as early as possible in your app lifecycle (e.g. in `Application.onCreate` on Android or `application(_:didFinishLaunchingWithOptions:)` on iOS).
{% endstep %}
{% endstepper %}

### Configuration options

| Parameter                 | Android | iOS | Description                                                       |
| ------------------------- | ------- | --- | ----------------------------------------------------------------- |
| `token`                   | ✓       | ✓   | Your app token (required).                                        |
| `invocationEvents`        | ✓       | ✓   | How the SDK is invoked (e.g. shake, screenshot, floating button). |
| `logLevel`                | ✓       | ✓   | SDK debug log level (e.g. `LogLevel.Debug`).                      |
| `appVariant`              | ✓       | ✓   | App variant (e.g. "beta", "production").                          |
| `androidApplication`      | ✓       | -   | Android `Application` instance (required on Android).             |
| `ignoreAndroidSecureFlag` | ✓       | -   | Whether to ignore FLAG\_SECURE for screenshots.                   |

### Managing permissions

{% hint style="warning" %}
Permissions are required for attachments (images, videos, audio) and some invocation methods. The native Luciq SDK may add or require permissions on each platform.
{% endhint %}

**Android**

Relevant permissions (e.g. storage, microphone) are typically declared by the native Luciq SDK. You can remove any you do not need. If you use **Screenshot** as an invocation event, storage permission may be requested at launch.

**iOS**

Add usage descriptions to your `Info.plist` as required by the native SDK, for example:

* `NSMicrophoneUsageDescription` – for voice notes
* `NSPhotoLibraryUsageDescription` – for image attachments

Permission prompts appear when the user tries to use a feature that needs them (e.g. attaching a photo or recording audio).

### Jetpack Compose (Android)

If your Android app uses **Jetpack Compose**, integrate the native Luciq Compose libraries so the SDK can track Compose screens, user interactions, and screen loading for APM. See [Jetpack Compose Integration](https://docs.luciq.ai/android/set-up-luciq-for-android/integrate-luciq-on-android/jetpack-compose-integration).

### SwiftUI (iOS)

If your iOS app uses **SwiftUI**, use the native Luciq SwiftUI APIs so the SDK can track SwiftUI views and measure screen loading for APM. See [Integrate SwiftUI](https://docs.luciq.ai/ios/setup-luciq-for-ios/integrate-luciq-on-ios/integrate-swiftui).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.luciq.ai/kmp/setup-luciq-for-kmp/integrating-luciq.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
