Configure the provider
SuqoProvider options, safe-area insets, and the package's exports.
Options
| Prop | Default | Notes |
|---|---|---|
mode | 'sandbox' | 'live' → app.suqo.ai, 'sandbox' → test.suqo.ai. |
baseUrl | — | Where SUQO's checkout is served from. Overrides mode. |
checkoutPath | /c/:id | The route, with :id for the checkout session id. |
title | Secure payment | Sheet header. The amount and seller are rendered by the page. |
loadingLabel | Loading secure checkout | The line under the spinner. Pass '' for a spinner alone. |
insets | measured | See Safe-area insets. |
debug | false | Turns 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.