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.

Initialize a client with a sessionToken provided by your backend. The client is optional, but it gives you a single place to manage the integration credentials used across the SDK.
Initialize client
import { createClient } from "@moonpay/platform-sdk-web";

const client = createClient({ sessionToken: "c3N0XzAwMQ==" });
createClient() returns the client synchronously. Method calls on the client (for example, client.getConnection()) return a Result<T, E> you check before reading value.

Parameters

PropertyTypeRequiredDescription
sessionTokenstringThe sessionToken created on your server.
apiBaseUrlstringOverride the MoonPay Platform API base URL. Defaults to production. Use this only when MoonPay support has asked you to point at a non-production environment.
frameBaseUrlstringOverride the MoonPay frame base URL. Defaults to production. Use this only when MoonPay support has asked you to point at a non-production environment.

Return value

createClient() returns a Client instance. It does not throw and does not return a Result.

Client

The client instance exposes every integration method: