> ## 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.4).
  The API is subject to change before the stable release.
</Warning>

## 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](/docs/checkout/client-session)

## Install the SDK

Add the Primer Checkout SDK dependency to your module-level `build.gradle.kts`:

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

Or using the BOM for version management:

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

## 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.
</Note>

## 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.error */ }
            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

<CardGroup cols={2}>
  <Card title="First Payment" icon="credit-card" href="/docs/checkout/primer-checkout/first-payment">
    Accept your first payment
  </Card>

  <Card title="Theming" icon="palette" href="/docs/checkout/primer-checkout/build-your-ui/styling-customization">
    Customize the appearance
  </Card>

  <Card title="Core Concepts" icon="lightbulb" href="/docs/checkout/primer-checkout/core-concepts">
    Understand the architecture
  </Card>

  <Card title="Settings" icon="gear" href="/docs/checkout/primer-checkout/configuration/sdk-options">
    Configure SDK behavior
  </Card>
</CardGroup>
