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:
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 for details.
@Composablefun 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)}