Declarative vs imperative
The SDK exposes two ways to present a frame:- Inline components — you render
<MoonPayBuyButton />,<MoonPayWidget />, etc. inside your own layout. The frame appears where the element sits in the tree. - Client methods — you call
client.setupWidget(),client.setupAddCard(), etc. The provider presents the frame in a full-screen modal that it manages for you.
<MoonPayProvider>.
The quote prop
The quote prop on <MoonPayBuyButton> and the other payment 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.
With headless, the frame reads a new quote only after an "error" with
code quoteExpired.
theme, url, externalTransactionId, headless — are
mount-time only. Changing them after the component mounts causes the frame to remount.
Headless components
These 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.
Component reference
Deprecated components
These components still work, but new integrations render<MoonPayBuyButton>
instead.