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

# Installation

> Add the Primer Checkout SDK to your Android project

> [!WARNING]
>
> Primer Checkout Android SDK is currently in **beta** (v3.0.0-beta.8).
> The API is subject to change before the stable release.

## Prerequisites

* Android API level 24+ (minSdk)
* Kotlin 2.0+ with the [Compose Compiler Gradle plugin](https://developer.android.com/develop/ui/compose/compiler)
* Jetpack Compose enabled in your project
* A `clientToken` from your server via the [Client Session API](https://primer.io/docs/checkout/client-session.md)

## Install the SDK

We recommend installing the SDK through the Primer BOM (`io.primer:bom`). The BOM sets the version of the SDK and of every Primer library you add, so you only set one version. Add it to your module-level `build.gradle.kts`:

```kotlin theme={"dark"}
dependencies {
    implementation(platform("io.primer:bom:3.0.0-beta.8"))
    implementation("io.primer:checkout")
}
```

Or without the BOM:

```kotlin theme={"dark"}
dependencies {
    implementation("io.primer:checkout:3.0.0-beta.8")
}
```

## Payment method dependencies

`io.primer:checkout` doesn't include the wrappers for 3DS, Klarna or Stripe ACH. Add one for each of these you enable in the Dashboard. Without the 3DS wrapper, card payments that need 3DS fail, and without the Klarna or Stripe wrapper, that method doesn't appear in the checkout.

The wrappers ship with the SDK at the same version. With the BOM, leave out the version:

```kotlin theme={"dark"}
dependencies {
    implementation(platform("io.primer:bom:3.0.0-beta.8"))
    implementation("io.primer:checkout")
    implementation("io.primer:3ds-android")    // 3DS on card payments
    implementation("io.primer:klarna-android") // Klarna
    implementation("io.primer:stripe-android") // Stripe ACH
}
```

Without the BOM, use the same version as `io.primer:checkout` for each wrapper.

## Compose Setup

Ensure Jetpack Compose is enabled in your module-level `build.gradle.kts`. The SDK uses the Kotlin Compose Compiler plugin — add it to your `plugins` block instead of setting `kotlinCompilerExtensionVersion`:

```kotlin theme={"dark"}
plugins {
    id("org.jetbrains.kotlin.plugin.compose") version "<your-kotlin-version>"
}

android {
    buildFeatures {
        compose = true
    }
}

dependencies {
    implementation(platform("androidx.compose:compose-bom:2025.12.00"))
    implementation("androidx.compose.ui:ui")
    implementation("androidx.compose.material3:material3")
    implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
}
```

> [!NOTE]
>
> The Primer SDK is built against a specific Compose BOM version. We recommend aligning your app's BOM version with ours to avoid binary incompatibilities. See the [Compose BOM to library version mapping](https://developer.android.com/develop/ui/compose/bom/bom-mapping) for details.

## Basic Usage

Add the checkout to your Composable:

```kotlin theme={"dark"}
@Composable
fun CheckoutScreen(clientToken: String) {
    val checkout = rememberPrimerCheckoutController(
        clientToken = clientToken,
    )

    // The sheet renders its own success/error screens. Observe state to
    // react programmatically (navigate, log, clear the cart).
    val state by checkout.state.collectAsStateWithLifecycle()
    LaunchedEffect(state) {
        when (val s = state) {
            is PrimerCheckoutState.Success -> { /* Navigate to confirmation */ }
            is PrimerCheckoutState.Failure -> { /* Inspect s.primerError */ }
            else -> Unit
        }
    }

    PrimerCheckoutSheet(checkout = checkout)
}
```

## Verify Installation

Build your project to confirm the SDK is resolved correctly:

```bash theme={"dark"}
./gradlew assembleDebug
```

If the build succeeds, the SDK is installed and ready to use.

## ProGuard / R8

The SDK includes its own ProGuard rules. No additional configuration is needed for release builds.

## Next Steps

> [card] [First Payment](https://primer.io/docs/checkout/primer-checkout/first-payment.md)
>
> Accept your first payment

> [card] [Theming](https://primer.io/docs/checkout/primer-checkout/build-your-ui/styling-customization.md)
>
> Customize the appearance

> [card] [Core Concepts](https://primer.io/docs/checkout/primer-checkout/core-concepts.md)
>
> Understand the architecture

> [card] [Settings](https://primer.io/docs/checkout/primer-checkout/configuration/sdk-options.md)
>
> Configure SDK behavior


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.