The React Native SDK wraps the MoonPay Developer Platform in aDocumentation 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> and a useMoonPay() hook. Frames render as native react-native-webview instances managed by the provider. The SDK ships with TypeScript types for autocomplete and inference.
The SDK is tested against:
- React Native 0.73+
- React 18.2+
react-native-webview13.0+- iOS 14+ and Android API 26+
Install
Install the SDK package and its peer dependency:react-native-webview install guide to link the native module. On iOS, run pod install from your ios/ directory.
Conventions
Provider + hook
Mount<MoonPayProvider> near the top of your app tree and call useMoonPay() from any descendant component to get the client. The provider renders frames automatically as siblings of its children when you call methods such as client.connect() or client.setupWidget().
App.tsx
Result<T, E>
Most SDK functions return a Result<T, E> instead of throwing.
| Field | Type | Required | Description |
|---|---|---|---|
ok | boolean | ✅ | Whether the operation succeeded. |
value | T | Present when ok is true. | |
error | E | Present when ok is false. |