Declarative vs imperative
The SDK exposes two ways to present a frame:- Inline components — you render
<MoonPayApplePayButton />,<MoonPayWidget />, etc. inside your own layout. The frame appears where the element sits in the tree. - Client methods — you call
client.setupApplePay(),client.setupWidget(), etc. The provider presents the frame in a full-screen modal that it manages for you.
<MoonPayProvider>.
The quote prop
The quote prop on the button and buy frame components accepts a quote
signature string from
client.getQuote(). This
prop is reactive: when you update it, the SDK pushes the new signature
directly into the live frame via setQuote without remounting or reloading.
theme, url, externalTransactionId — are mount-time
only. Changing them after the component mounts causes the frame to remount.
Headless components
Three components render nothing visible (0×0) and exist for API uniformity — they are the declarative alternatives to their imperative counterparts:
Results from these components arrive through their
onEvent callback.