WDK logoWDK documentation

Get Started

Install the package and initialize MoonPayProtocol with your wallet and keys.

This guide covers installation and initializing the protocol. You need Node.js, npm, and MoonPay API keys from your MoonPay dashboard.

Installation

Run the following to install @tetherto/wdk-protocol-fiat-moonpay:

Install with npm
npm install @tetherto/wdk-protocol-fiat-moonpay

Initialize MoonPayProtocol

You can create a fiat ramp client with new MoonPayProtocol(account, config):

Construct MoonPayProtocol
import MoonPayProtocol from '@tetherto/wdk-protocol-fiat-moonpay'

const moonpay = new MoonPayProtocol(walletAccount, {
  apiKey: process.env.MOONPAY_PUBLISHABLE_KEY,
  secretKey: process.env.MOONPAY_SECRET_KEY
})

Never ship a secret key to browsers. Run server-side signing where your architecture allows, and rotate keys if they leak.

See Configuration for cacheTime and related options.

Next Steps

On this page