🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@moonpay/moonpay-node

Package Overview
Dependencies
Maintainers
8
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moonpay/moonpay-node

The MoonPay NodeJS SDK allows you to easily use MoonPay server-side functions.

0.2.11
latest
npm
Version published
Maintainers
8
Created
Source

@moonpay/moonpay-node

A node package for MoonPay server-side functions

Setup

Set up the MoonPay class with your secret key.

Note: ⚠️ NEVER use your secret key in client side code. ⚠️

You will probably want to load the test key from an environment variable.

const moonPay = new MoonPay('sk_test_...');

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.

const signature = moonPay.url.generateSignature(
  'https://buy.moonpay.com/?apiKey=pk_test_123&walletAddress=...',
);

Or, return the signed URL, using the returnFullURL option.

const signedURL = moonPay.url.generateSignature(
  'https://buy.moonpay.com/?apiKey=pk_test_123&walletAddress=...',
  { returnFullURL: true },
);

Verifying a signature

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

const isSignatureValid = moonPay.url.isSignatureValid(
  '[...]/?apiKey=pk_test_123&signature=someSignature',
);

Generating a signed URL

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

const params = {
  apiKey: 'pk_test_123',
  baseCurrencyCode: 'GBP',
};

const url = moonPay.url.generate({ flow: 'buy', params });

FAQs

Package last updated on 12 Jun 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