Socket
Book a DemoInstallSign in
Socket

@moonpay/react-native-moonpay-sdk

Package Overview
Dependencies
Maintainers
8
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moonpay/react-native-moonpay-sdk

The MoonPay Mobile SDK enables you to integrate the MoonPay widget so you can facilitate crypto purchases within your platform.

1.1.6
latest
npmnpm
Version published
Weekly downloads
1.2K
-1.5%
Maintainers
8
Weekly downloads
 
Created
Source

@moonpay/react-native-moonpay-sdk

The MoonPay React Native SDK enables you to integrate the MoonPay widget so you can facilitate crypto purchases within your platform.

Documentation

For detailed integration instructions and further documentation, please visit our Documentation Site.

Installation

To install the package, use npm or yarn:

npm install --save @moonpay/react-native-moonpay-sdk

or

yarn add @moonpay/react-native-moonpay-sdk

Prerequisites

Before using this package, make sure you have the following:

  • An active MoonPay account.
  • Your MoonPay API key.

Usage

  • Import the useMoonPaySdk hook in you React Native component
import { useMoonPaySdk } from '@moonpay/react-native-moonpay-sdk';
  • Invoke the hook with the passed configuration object

If you want to display the widget in a WebView:

const { MoonPayWebViewComponent } = useMoonPaySdk({
  sdkConfig: {
    flow: 'buy',
    environment: 'sandbox',
    params: {
      apiKey: 'pk_test_123',
    },
  },
});

return (
  <View>
    <MoonPayWebViewComponent />
  </View>
);

If you want to display the widget in an In-App browser:

import { InAppBrowser } from 'react-native-inappbrowser-reborn';

const { openWithInAppBrowser } = useMoonPaySdk({
  sdkConfig: {
    flow: 'buy',
    environment: 'sandbox',
    params: {
      apiKey: 'pk_test_123',
    },
  },
  browserOpener: {
    open: async (url: string) => {
      if (await InAppBrowser.isAvailable()) {
        await InAppBrowser.open(url);
      }
    },
  },
});

return (
  <View>
    <Button onPress={openWithInAppBrowser} />
  </View>
);
import * as WebBrowser from 'expo-web-browser';

const { openWithInAppBrowser } = useMoonPaySdk({
  sdkConfig: {
    flow: 'buy',
    environment: 'sandbox',
    params: {
      apiKey: 'pk_test_123',
    },
  },
  browserOpener: {
    open: async (url: string) => {
      await WebBrowser.openBrowserAsync(url);
    },
  },
});
import { Linking } from 'react-native';

const { openWithInAppBrowser } = useMoonPaySdk({
  sdkConfig: {
    flow: 'buy',
    environment: 'sandbox',
    params: {
      apiKey: 'pk_test_123',
    },
  },
  browserOpener: {
    open: async (url: string) => {
      await Linking.openURL(url);
    },
  },
});

return (
  <View>
    <Button onPress={openWithInAppBrowser} />
  </View>
);

Keywords

react-native

FAQs

Package last updated on 12 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.