Overview
INFO
The Android / Kotlin SDK is designed for Bolt Managed Checkout and SSO Login. It handles the full checkout experience — including shipping, payment, and order completion — as well as Bolt account authentication via OAuth 2.0.
The Bolt Android SDK (com.bolt:checkout) provides a streamlined integration for launching Bolt’s managed checkout flow and SSO login from your Android app. The SDK handles the complete checkout UI, 3D Secure challenges, and payment authorization, so you can focus on your app experience.
Completing the integration requires three primary steps:
- Initialize the SDK with your publishable key.
- Register an activity result launcher to handle lifecycle events.
- Launch the checkout flow using an order token generated by your backend.
Installation
The SDK artifact is published to Maven Central. Add it to your app-level build.gradle or build.gradle.kts file:
dependencies {
implementation("com.bolt:checkout:<version>")
}
You can find the latest version on Maven Central.
SDK Initialization
The SDK must be initialized exactly once during your application’s lifecycle. The best place to do this is in your custom Application class’s onCreate() method.
First, declare your application subclass in your AndroidManifest.xml:
<application
android:name=".MyApplication"
...>
</application>
Then initialize BoltCheckout with your application context, publishable key, and environment:
import android.app.Application
import com.bolt.checkout.BoltCheckout
import com.bolt.checkout.model.BoltEnvironment
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
BoltCheckout.init(
application = this,
publishableKey = "YOUR_PUBLISHABLE_KEY",
environment = BoltEnvironment.PRODUCTION, // or BoltEnvironment.SANDBOX for testing
)
}
}
WARNING
BoltCheckout.init() will throw an exception if called more than once. BoltCheckout.get() will throw an exception if called before init() has completed successfully.
Configuration Requirements
To use the SDK, ensure you have the following credentials properly configured:
| Credential | Where it’s used | Description |
|---|---|---|
publishableKey |
BoltCheckout.init() |
Your unique merchant identifier provided by Bolt. |
orderToken |
BoltCheckoutConfig |
A unique, per-checkout token generated by your backend server. |
Next Steps
- Checkout Flow — Generate order tokens and launch the managed checkout experience.
- SSO Login — Authenticate users with their Bolt account via OAuth 2.0.
- Custom Checkout — Build a custom checkout using the payment flow and authorization APIs.
- API Reference — Full reference for all delegates, result types, and callbacks.