Documentation Index
Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt
Use this file to discover all available pages before exploring further.
<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 such asclient.connect() or client.setupWidget(), the provider mounts a react-native-webview as a sibling of its children. Visible frames render with flex: 1; hidden utility frames (such as the one used by client.getConnection()) render with zero dimensions.
Layout
<MoonPayProvider> near the top of your app, but below your navigation container so frames participate in the active screen’s layout.
Client methods
The hook exposes aclient object with every integration method:
client.getConnection()client.connect()client.resetConnection()client.getPaymentMethods()client.deletePaymentMethod()client.getQuote()client.getTransaction()client.listTransactions()client.setupWidget()client.setupApplePay()client.setupGooglePay()client.setupBuy()client.setupBuyButton()client.setupChallenge()client.setupAddCard()