SUQODocs
User GuideAPI ReferenceSDKs

Configure the provider

SuqoProvider options, safe-area insets, and the package's exports.

Options

PropDefaultNotes
mode'sandbox''live' → app.suqo.ai, 'sandbox' → test.suqo.ai.
baseUrl—Where SUQO's checkout is served from. Overrides mode.
checkoutPath/c/:idThe route, with :id for the checkout session id.
titleSecure paymentSheet header. The amount and seller are rendered by the page.
loadingLabelLoading secure checkoutThe line under the spinner. Pass '' for a spinner alone.
insetsmeasuredSee Safe-area insets.
debugfalseTurns on this package's redacted console logging.
onEvent—A debug stream for your own logs. Not a payment signal.

Safe-area insets

Without insets the screen measures the safe area with a platform heuristic: status-bar height and a nav-bar estimate on Android, a home-indicator guess on iOS. It is a reasonable default, not a solved problem.

If your app already has react-native-safe-area-context, pass real values:

import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { SuqoProvider } from '@suqo/react-native'

function Root() {
  const insets = useSafeAreaInsets()

  return (
    <SuqoProvider mode="sandbox" insets={{ top: insets.top, bottom: insets.bottom }}>
      <Navigation />
    </SuqoProvider>
  )
}

Render Root inside a SafeAreaProvider, as react-native-safe-area-context requires.

Environments and exports

import {
  SuqoProvider, useSuqoCheckout,
  LIVE_ORIGIN, SANDBOX_ORIGIN, resolveBaseUrl, DEFAULT_CHECKOUT_PATH,
  SuqoConfigError, VERSION,
} from '@suqo/react-native'

LIVE_ORIGIN / SANDBOX_ORIGIN are the two origins mode picks between. resolveBaseUrl is the same resolution <SuqoProvider> runs internally (baseUrl, else mode, defaulting to sandbox), exported for anywhere else in your app that needs to build a SUQO URL consistently. SuqoConfigError is what open() rejects with for both of its two failure reasons — check error instanceof SuqoConfigError rather than matching its message.

On this page