> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure the SDK

> Initialize the Encore KMP SDK in your app.

## Configure

Call `configure()` once, early in your app lifecycle. This is shared code:

```kotlin theme={null}
import com.encorekit.kmp.Encore
import com.encorekit.kmp.models.LogLevel

Encore.configure(
    apiKey = "pk_your_api_key",
    logLevel = LogLevel.DEBUG, // NONE, ERROR, WARN, INFO, DEBUG
)
```

<Info>
  Duplicate calls to `configure()` are ignored with a warning.
</Info>

***

## Android: Platform Glue

Android requires two additional calls because the native SDK needs a `Context` to initialize and an `Activity` reference to present offer UI. These go in your platform-specific code, not in shared:

```kotlin theme={null}
// Application.kt
import com.encorekit.kmp.Encore
import com.encorekit.kmp.configure

class MyApp : Application() {
    override fun onCreate() {
        super.onCreate()
        Encore.configure(this, "pk_your_api_key")
    }
}
```

```kotlin theme={null}
// MainActivity.kt
import com.encorekit.kmp.Encore
import com.encorekit.kmp.setActivity

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Encore.setActivity(this)
    }

    override fun onDestroy() {
        Encore.setActivity(null)
        super.onDestroy()
    }
}
```

<Note>
  On Android, use the `configure(context, apiKey)` extension instead of the shared `configure(apiKey)` — it passes the Application context to the native SDK. iOS needs no platform glue.
</Note>

***

## Next Steps

* **[Identify Users](./user-management)** — Associate users for offer targeting
* **[Present Offers](./present-offers)** — Show retention offers at key moments
