Skip to main content

Documentation Index

Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt

Use this file to discover all available pages before exploring further.

The Web SDK is designed for first-party browser apps. It includes TypeScript types for autocomplete and type inference. The SDK is tested against the latest versions of:
  • Chrome (Desktop, iOS, Android)
  • Safari (macOS)
  • Safari (iOS)
  • Firefox
Currently, the SDK does not support React Native.

Install

Install the SDK package:
pnpm i @moonpay/platform

Conventions

Result<T, E>

Most SDK functions return a Result<T, E> instead of throwing.
FieldTypeRequiredDescription
okbooleanWhether the operation succeeded.
valueTPresent when ok is true.
errorEPresent when ok is false.
Use this pattern to branch on success vs failure:
const result = await someSdkCall();

if (!result.ok) {
  // Handle error
  console.error(result.error);
  return;
}

console.log(result.value);

Function reference

These pages document individual SDK functions, including parameters and return types:

Create a reusable client

Check the customer’s connection

Connect a customer

List payment methods

Get a quote

Set up Apple Pay