Skip to main content
Primer Checkout React Native SDK is currently in beta (v3.0.0-beta.1). The API is subject to change before the stable release.
PrimerSettings is the SDK configuration object. Pass it as the settings prop of PrimerCheckoutProvider.

Definition

Import the type with import type { PrimerSettings } from '@primer-io/react-native'. The block below shows the shape of the type, not code to copy.
The sections below list the fields of the nested objects. The type of apiVersion is exported as PrimerApiVersion.

Usage

settings that the native SDK cannot decode make initialization fail, for example an apiVersion other than '2.4' or 'latest'. The failure arrives in usePrimerCheckout().error. See PrimerError.

paymentMethodOptions

See Native setup for the app-side setup that URL schemes, Apple Pay, Google Pay, Klarna and Stripe ACH need.

Apple Pay options

applePayOptions is read on iOS only. RequiredContactField is 'name' | 'emailAddress' | 'phoneNumber' | 'postalAddress'.

Google Pay options

googlePayOptions is read on Android only.

uiOptions

Primer Checkout reads these keys from uiOptions.
The sheet closes only when your onRequestDismiss handler sets visible to false. When you turn a result screen off, keep the result yourself when it arrives, because the sheet clears paymentOutcome before it calls onRequestDismiss. To show your own result screens, see Status screens.

headlessUniversalCheckoutCallbacks

Event callbacks from the native SDK. onCheckoutComplete, onError and onBeforePaymentCreate are also props of PrimerCheckoutProvider. When you set a callback both as a prop and here, both run, the prop first, with the same arguments. onTokenizationStart, onPreparationStart, onPaymentMethodShow, onBeforeClientSessionUpdate, onCheckoutResume and onCheckoutPending are forwarded from the native SDK when you set them.
For the payment result, read usePrimerCheckout().paymentOutcome. It is set for every payment attempt, with the status 'success', 'pending' or 'error'. See Handle the payment result.

See also

PrimerCheckoutProvider

The provider that takes these settings

Native setup

URL schemes, Apple Pay, Google Pay and optional dependencies

PrimerError

Errors and where they arrive

PrimerThemeOverride

Theme the checkout and set the appearance mode