<MoonPayProvider> initializes the SDK with a sessionToken and renders MoonPay frames as react-native-webview instances when you call SDK methods. Wrap the part of your app that needs access to the client.
App.tsx
useMoonPay().
Props
| Property | Type | Required | Description |
|---|---|---|---|
sessionToken | string | ✅ | The sessionToken created on your server. |
children | ReactNode | ✅ | Your app tree. Components below the provider can call useMoonPay(). |
apiBaseUrl | string | Override the MoonPay Platform API base URL. Defaults to production. Use this only when MoonPay support has asked you to point at a non-production environment. | |
frameBaseUrl | string | Override the MoonPay frame base URL. Defaults to production. Use this only when MoonPay support has asked you to point at a non-production environment. |
Frame rendering
When you call a method that opens a visible frame — such asclient.connect(),
client.setupWidget(), or client.setupAddCard() — the provider presents it
in a full-screen native Modal with a slide animation. Multiple frames stack
naturally: for example, a challenge frame appears on top of an active widget.
On Android, the hardware back button dismisses the top frame and disposes it.
Hidden utility frames (used by client.getConnection(), client.setupBuy(),
and client.resetConnection()) render as zero-size siblings with no visible
impact on your layout.
Layout
Client methods
The hook exposes aclient object with every integration method:
client.getConnection()client.connect()client.setupAuth()client.resetConnection()client.getPaymentMethods()client.deletePaymentMethod()client.getQuote()client.getTransaction()client.listTransactions()client.setupWidget()client.setupBuy()client.setupChallenge()client.setupAddCard()client.setupApplePay()(deprecated — use<MoonPayApplePayButton>instead)client.setupGooglePay()(deprecated — use<MoonPayGooglePayButton>instead)client.setupBuyButton()(deprecated — use<MoonPayBuyButton>instead)