Skip to main content

Install

View the package on npm.

Setup

First, import the MoonPay class.
Set up the MoonPay class with your secret key.
NEVER use your secret key in client side code. Load your secret key from an environment variable instead.

Usage

Use the moonPay instance to access our functions.

URL utilities

MoonPay URL utilities are namespaced under the .url property.

Signing your URL

If you include the walletAddress or walletAddresses query param, you’ll need to sign the URL.
Or, return the signed URL, using the returnFullURL option.

Verifying a signature

Or, you can verify that a URL is correctly signed.

Generating a signed URL

You can also have us generate the full, signed URL, based on some input parameters.

Example

Here’s an example of an Express endpoint that signs a URL query param.