Skip to main content
Fireblocks Flow is an enterprise feature. Contact us to enable it for your environment.
FlowWidget is a prebuilt React component that runs the payer’s side of a Flow payment. You give it the ID of a flow your server created, and it loads the flow, lets the payer choose how to pay, runs the payment, and shows the result. It calls the same SDK functions described in Build a custom payment UI, so use that guide instead when you need screens the widget does not provide.

Prerequisites

  • @dynamic-labs-sdk/react-ui installed, flow.css imported, and your app wrapped in DynamicUiProvider with the dyn-flow-root class, as described in React UI components.
  • The chains your payers pay from enabled in the Dynamic Console and their chain extensions registered, as described in Get started with Flow payments. Wallet payments need them. Exchange and deposit-address payments do not.
  • A server that creates the flow and passes flow.id to the payer’s page, as described in Create a flow from your server.

Add the widget

Render FlowWidget with the flow ID:
This example mounts DynamicUiProvider next to the widget. If your app already has one at its root with the dyn-flow-root class, render FlowWidget on its own.

What the payer sees

The widget moves through these screens on its own:
  1. Loading. The widget shows a loader while it reads the flow, and an error with a retry button when the flow cannot load.
  2. Payment method. The payer chooses to pay from a wallet, through an exchange, or by sending funds to a deposit address. When only one method is enabled, the widget skips this screen.
  3. The chosen method.
    • Wallet. The payer connects a wallet, chooses the token to pay with, reviews the quote, and approves the transaction in the wallet. If they decline in the wallet, the widget lets them try again or choose another method.
    • Exchange. The payer chooses an exchange, which opens in a new tab so they can buy the payment amount. The widget waits until the exchange confirms the purchase.
    • Deposit address. The payer chooses the network and token to send and gives a refund address, and the widget shows the address and the exact amount to send. It then waits for the deposit.
  4. Processing. The widget shows the payment’s progress after the funds are sent.
  5. Outcome. The widget ends on payment complete, failed, refunded, cancelled, or expired, according to the flow’s state.
The payer can go back from a method to the payment method choice. When they go back after opening an exchange or after receiving a deposit address, the widget asks them to confirm first, because a purchase or a deposit they already started can still arrive. The widget reads the flow’s state when it loads, so a payer who reloads the page or reopens the payment link returns to where they were. A flow that already has a quote, or that is waiting for an exchange purchase, resumes on the method that started it, and a flow that has already finished opens on its outcome.

Handle the outcome

The widget calls one outcome callback with the latest Flow object: Each callback fires at most once while the widget stays mounted. A new mount reports again: reloading the page or reopening the payment link for a finished flow calls the matching callback once more. Make your handlers idempotent by keying them on flow.id. Use the callbacks to update the payer’s page, such as to show your own confirmation or move to the next step. Decide whether to fulfill the order on your server, from webhooks or a server read of the flow, rather than from what the payer’s page reports. Access and data explains why. Mount one widget per flow. Two widgets for the same flow each report the outcome, so your handlers run twice. Changing flowId on a mounted widget starts a new payment for the new flow.

Configure the widget

Pass settings to change what the widget shows. Each field you set replaces the matching value in the flow’s uiConfig, which your server can set when it creates the flow, as described in UI configuration. A field you leave out falls back to the flow’s value.
payerEvmAddress is an address your app already holds for the payer. enabledPaymentMethods controls only what the widget shows. The API does not enforce it, so a payer can still attach another source with direct requests, and you should not rely on it for a compliance rule. Payment sources explains this further.

Offer one payment method

Each payment method is also available as its own widget, for a page that offers only that method or that builds its own method choice. They take the same flowId, className, onPaymentCompleted, and onPaymentFailed props as FlowWidget, and they handle loading, processing, outcomes, and reloads the same way.

What the widget does not cover

Build these with the SDK, as described in Build a custom payment UI, when your payment page needs them:
  • Cancelling a flow. The widget has no cancel control. See Cancel.
  • Changing the amount in deposit mode. The widget quotes the amount the flow was created with. See Deposit mode amount entry.

Change the text

Each Flow screen has its own slot in the DynamicUiProvider text dictionary, named after the screen, such as dyn-flow-choose-payment-source-view for the payment method choice. Text keys lists every Flow slot and key, grouped by screen, with its default.
Last modified on November 5, 2026