@moonpay/moonpay-js
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

@moonpay/moonpay-js

The MoonPay Web 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/moonpay-js

or

yarn add @moonpay/moonpay-js

Prerequisites

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

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

Usage

  1. Import the loadMoonPay function.
import { loadMoonPay } from '@moonpay/moonpay-js';
  1. Call the loadMoonPay function to get the constructor for the MoonPayWebSdk.
const moonPay = await loadMoonPay();

const widget = moonPay({
  flow: 'buy',
  environment: 'sandbox',
  params: {
    apiKey: 'pk_test_123',
  },
  variant: 'overlay',
});
  1. Call the show method on your instance
widget.show();

/@moonpay/moonpay-js/

    Package Sidebar

    Install

    npm i @moonpay/moonpay-js

    Weekly Downloads

    4,442

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    55.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • vfaramond
    • tomislavhrenmp
    • jpulsifer-moonpay
    • npmitservices
    • ihell
    • moonpay-engineering
    • sbsto
    • moonpay-security