> For the complete documentation index, see [llms.txt](https://docs.getupdraft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getupdraft.com/updraft-sdk/integrating-updraft-kotlin-multiplatform-sdk.md).

# Integrating Updraft Kotlin Multiplatform SDK

## Updraft KMP / Compose Multiplatform

Use Updraft from shared Kotlin Multiplatform code. `updraft-core` provides the logic; `updraft-ui-compose` adds the built-in feedback UI.

**Source:** [github.com/appswithlove/updraft-sdk](https://github.com/appswithlove/updraft-sdk)

### Requirements

* Kotlin 2.2+
* Android `minSdk` 23, iOS 14.0+

### 1. Add dependencies

Version catalog (`gradle/libs.versions.toml`):

```toml
[versions]
updraft = "2.0.0"

[libraries]
updraft-core = { module = "com.appswithlove.updraft:updraft-core", version.ref = "updraft" }
updraft-ui-compose = { module = "com.appswithlove.updraft:updraft-ui-compose", version.ref = "updraft" }
```

In your shared module's `build.gradle.kts`:

```kotlin
kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation(libs.updraft.core)
            implementation(libs.updraft.ui.compose)
        }
    }
}
```

### 2. Initialize

#### Common

```kotlin
Updraft.start(
    UpdraftSettings(
        appKey = APP_KEY,
        sdkKey = SDK_KEY,
    ),
)
```

#### iOS

After `start`, wire up the platform integration:

```kotlin
fun startUpdraft() {
    Updraft.start(UpdraftSettings(appKey = APP_KEY, sdkKey = SDK_KEY))
    UpdraftIos.autoWire()
}
```

Call `startUpdraft()` from your iOS app entry point.

#### Android (optional custom hosting)

Native Android auto-wires by default. To route the feedback event through your own navigation:

```kotlin
@Composable
fun App() {
    UpdraftEventHost(
        events = Updraft.events,
        onFeedbackRequested = {
            val screenshotPng = Updraft.takePendingScreenshot()
            navigateToFeedback(screenshotPng)
        },
    )
}
```

### Settings

See the full `UpdraftSettings` reference.

### Feedback

With `updraft-ui-compose`, the built-in feedback UI is shown automatically on shake (Android/iOS) or screenshot (iOS).

For a custom UI, use `updraft-core` alone and provide a presenter:

```kotlin
Updraft.setFeedbackUiPresenter { screenshotPng ->
    // show your UI
    Updraft.sendFeedback(screenshot, type, description, email)
        .collect { progress -> /* 0.0 → 1.0 */ }
}

Updraft.onFeedbackUiClosed() // re-arm shake detection
```

#### Events

Subscribe to updates, feedback hints, and errors:

```kotlin
Updraft.events: SharedFlow<UpdraftEvent>
```

#### Navigation stack

```kotlin
Updraft.navigationStackProvider = {
    listOfNotNull(navController.currentBackStackEntry?.destination?.route)
}
```

Disable with `sendNavigationStack = false`.

### Auto Update

Enable on the getupdraft.com dashboard; the SDK compares build numbers and prompts testers to install newer versions.
