The iOS SDK exposes one managed entry point and one composable entry point. Both are built on the same observable PrimerCheckoutSession, which owns the checkout lifecycle: it loads the client session, tracks the lifecycle Phase, and delivers the final PrimerCheckoutState.
Hold a PrimerCheckoutSession as a @StateObject, then attach it to your view hierarchy with the .primerCheckoutSession(_:onCompletion:) modifier. The composable views — PrimerCardForm, PrimerPaymentMethods, and PrimerVaultedPaymentMethods — resolve their per-feature session from the SwiftUI environment and expose @ViewBuilder slots you can override.
@StateObject private var session = PrimerCheckoutSession(clientToken: token)var body: some View { ScrollView { PrimerCardForm() PrimerPaymentMethods() } .primerCheckoutSession(session) { state in handle(state) }}
Each composable view receives its session as a slot parameter so you can read state and call actions from your custom UI:
Sessions are @MainActorObservableObjects. Observe them with @StateObject (when you own them) or @ObservedObject (when they are passed into a slot), and read their @Publishedstate/phase directly in your views.
Start with the managed PrimerCheckout view to get a working checkout quickly, then move to the composable views and @ViewBuilder slots when you need full control over the UI.