<MoonPayBuyFrame> is a headless component (renders nothing visible) that
drives the buy pipeline. It is the declarative alternative to
client.setupBuy().
Use this component when you want to drive the buy flow without a visible frame
— for example, to present your own UI while the transaction processes in the
background, then show <MoonPayChallenge>
only if a challenge step is required.
The quote prop is reactive: updating it pushes the new signature directly
into the live frame without a remount.
BuyFlow.tsx
Props
| Prop | Type | Required | Description |
|---|---|---|---|
quote | string | ✅ | Quote signature from getQuote(). Reactive — updating this prop pushes the new signature into the frame without a remount. |
externalTransactionId | string | Partner-assigned identifier for this transaction attempt. Mount-time only. | |
onEvent | (event: BuyEvent) => void | Callback for buy frame lifecycle events. See BuyEvent. |
style prop.
BuyEvent
| kind | Payload | When you receive it |
|---|---|---|
"ready" | — | The buy frame is ready. |
"complete" | { transaction: FrameTransaction } | The purchase finished. Inspect FrameTransaction for the outcome. |
"challenge" | { kind: "frame"; url: string } | Verification required. Render <MoonPayChallenge> with the provided URL. |
"error" | { code: string; message: string } | The flow encountered an error. |