Skip to main content
Render the MoonPay buy widget into your UI and initiate a transaction with a quote signature. The quote must have executable: true. The widget handles the full purchase flow — including payment-method selection, verification, and transaction confirmation — inside an iframe.
Setup widget

Parameters

This method does not require a separate auth token. The client uses stored credentials from an active connection.

WidgetEvent

onEvent receives events as the widget flow progresses. Use event.kind to decide how to handle each event.

FrameTransaction

The transaction reported by the widget on "complete". The shape depends on the outcome. To track the final status after "complete", pass transaction.id to client.getTransaction().

WidgetEventError

Result

client.setupWidget() returns a Result<WidgetFrame, SetupWidgetError>.

Result envelope

Result<WidgetFrame, SetupWidgetError>

WidgetFrame

SetupWidgetError

types.ts