<MoonPayConnect> renders the MoonPay connect flow inline in your layout. It
is the declarative alternative to
client.connect().
When the customer completes the flow with an active connection, credentials are
decrypted and stored on the shared client automatically. Subsequent calls to
client.getQuote(), client.setupApplePay(), etc. use those credentials
without any extra steps.
If you want the full end-to-end flow (create session → check connection →
connect), start with the
Connect a customer guide.
ConnectScreen.tsx
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
theme | { appearance?: "light" | "dark" } | — | Appearance override for the connect frame. Mount-time only. | |
onEvent | (event: ConnectEvent) => void | — | Callback for connect lifecycle events. See ConnectEvent. | |
style | ViewStyle | flex: 1 | Container style. |
ConnectEvent
Use event.kind to handle each event.
| kind | Payload | When you receive it |
|---|---|---|
"ready" | — | The connect UI is rendered and ready. |
"complete" | Connection | The customer completed the flow. Same shape as client.getConnection() returns. |
"error" | ConnectEventError | The flow encountered an error. |
ConnectEventError is discriminated by code:
code | Extra fields | Description |
|---|---|---|
"validationError" | errors: ConfigValidationFieldError[] | One or more session/client/public-key fields are invalid. |
"generic" | message?: string | A generic connection failure. |
ConfigValidationFieldError entries have code: "invalidSessionToken" | "invalidClientToken" | "invalidPublicKey" and a
developer-facing message.