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.
Install
Install the official MoonPay package.Install dependencies
Assuming you already installedreact and react-native you need to install and configure react-native-webview.
In-App Browser Implementation
You no longer need to installexpo-web-browser or react-native-inappbrowser-reborn as optional dependencies. Instead, partners are now required to provide their own in-app browser implementation when using the MoonPay SDK. You can either use expo-web-browser, react-native-inappbrowser-reborn, or any standalone in-app browser of your choice. Alternatively, you can create a wrapper to manage the in-app browser you prefer to use.
Initialize
Initialize the SDK in your application with the flow, environment and any parameters related to Buy, Sell or Swap. Additionally you can choose to render the widget either as an in-app browser or a webview. If you’re using thewalletAddress or walletAddresses query param, you need to sign your widget URL before you can display the widget. Learn more about URL signing.
How to choose?
- An
In-app browserwill allow you to use native features like Google Pay, social sign-in and popups. - A
Webviewwill allow you to use a communication layer between the widget and your app and therefore get your app to perform certain actions once some events occur in the widget. Additionally it will give you infinite choices on how it might look like. You can add it to a bottom sheet, drawer, or as full-screen. It’s entirely up to you.
Configuration
- Possible values for
flow: buy, sell, swap, swapsCustomerSetup - Possible values for
environment: sandbox, production