This SDK is for use with Bolt Embeddable Checkout. For the full backend API documentation, see the Embeddable Checkout API Reference.

Root Exports

Import from: @boltpay/react-native
ExportDescription
BoltClient class. Takes { publishableKey, environment?, language? }.
BoltProviderReact context provider. Wrap your app with <BoltProvider client={bolt}>.
useBolt()Hook to access the Bolt client from any component.
bolt.configureOnPageStyles(styles)Set global v3 styles applied to all elements.

Payment Exports

Import from: @boltpay/react-native/payments
ExportDescription
CreditCard.ComponentWebView-based credit card input.
CreditCard.useController(options?)Returns a controller with tokenize(), on(), and setStyles().
useThreeDSecure()Hook returning { Component, fetchReferenceID(), challengeWithConfig() }.
ApplePayNative PKPaymentButton (iOS only; renders nothing on Android).
GoogleWalletNative Google Pay PayButton (Android only; renders nothing on iOS).

Credit Card Controller

MethodDescription
tokenize()Returns Promise<TokenResult | Error>. Never throws.
on(event, callback)Register event listener. Events: valid, error, blur, focus.
setStyles(styles)Update input field styles.

3D Secure

MethodDescription
fetchReferenceID(creditCardInfo)Accepts TokenResult or CreditCardId. Returns Promise<string>. Throws ThreeDSError.
challengeWithConfig(orderToken, config)Returns Promise<ThreeDSResult>. Never throws. Check result.success.

ApplePay Props

PropTypeDefaultDescription
configApplePayConfigrequiredCountry/currency, total amount, and optional merchant ID (mode='native' only).
onComplete(ApplePayResult) => voidrequiredCalled with token, bin, expiration, and billing contact on success.
onError(Error) => void:Called on payment failure.
mode'webview' | 'native''webview''webview' uses the Bolt-hosted iframe. 'native' uses PassKit.
buttonTypeApplePayButtonType'plain'Button label variant. Auto-localized by Apple.
buttonStyle'black' | 'white' | 'whiteOutline''black'Button color theme.
referrerstring:Merchant website URL. Required for mode='webview'.
styleViewStyle:Container style overrides.

GoogleWallet Props

PropTypeDefaultDescription
configGooglePayConfigrequiredPresentation options: currency, amount, label, billing address format. Merchant config is auto-fetched from Bolt.
onComplete(GooglePayResult) => voidrequiredCalled with token, bin, expiration, and billing address on success.
onError(Error) => void:Called on payment failure or cancellation.
buttonTypeGooglePayButtonType'plain'Maps to ButtonConstants.ButtonType. Auto-localized.
buttonThemeGooglePayButtonTheme'dark''dark' or 'light'. Maps to ButtonConstants.ButtonTheme.
borderRadiusnumber:Corner radius in dp.
styleViewStyle:Container style overrides.

Types

Import from: @boltpay/react-native/payments

Styles

type Styles = { [key: `--bolt-${string}`]: string };
V3 CSS custom properties. See Styling for usage.

TokenResult

{
  token?: string;
  last4?: string;
  bin?: string;
  network?: string;
  expiration?: string;
  postal_code?: string;
}

CreditCardId

{
  id: string;       // from Bolt's Add Card API
  expiration: string;
}

CreditCardInfo

type CreditCardInfo = CreditCardId | TokenResult;
Input for fetchReferenceID().

ThreeDSConfig

{
  referenceID: string;
  jwtPayload: string;
  stepUpUrl: string;
}

ThreeDSResult

{
  success: boolean;
  error?: ThreeDSError;
}

ThreeDSError

Error subclass with a numeric code property (1001–1010). See Error Codes below.

EventType

type EventType = 'error' | 'valid' | 'blur' | 'focus';

ApplePayResult

{
  token: string;
  bin?: string;
  expiration?: string;
  billingContact?: object;
  boltReference?: string;
}

ApplePayButtonType

Apple-approved button label variants: 'plain' | 'buy' | 'checkout' | 'book' | 'subscribe' | 'donate' | 'order' | 'setUp' | 'inStore' | 'reload' | 'addMoney' | 'topUp' | 'rent' | 'support' | 'contribute' | 'tip'

ApplePayConfig

Apple Pay configuration including merchant ID (for native mode), country/currency, and total amount.

GooglePayResult

{
  token: string;
  bin?: string;
  expiration?: string;
  email?: string;
  billingAddress?: object;
  boltReference?: string;
}

GooglePayButtonType

Google-approved button label variants: 'plain' | 'buy' | 'pay' | 'checkout' | 'subscribe' | 'donate' | 'order' | 'book'

GooglePayButtonTheme

'dark' | 'light'

GooglePayConfig

{
  billingAddressCollectionFormat?: string;
  currencyCode?: string;
  label?: string;
  amount?: string;
}
Merchant and gateway config is auto-fetched from Bolt: you only provide presentation options.

Error Codes

ThreeDSError includes a numeric code property with the following values:
CodeDescription
1001Credit card id or token must be supplied
1002Credit card id and token cannot both be supplied
1003Malformed credit card token
1004Order token does not exist
1005API response error during verification
1006Verification not required
1007Setup error during verification
1008Authentication failed
1009Failed to create challenge or challenge failed
1010Failed to get device data collection jwt