Skip to main content
The drop-in widget is the fastest way to add a deposit flow to your app. You provide a config, Trustware handles wallet discovery, and users move through the full hosted flow without any wallet state management on your side.

When to use this pattern

Choose this pattern when:
  • your app does not already have a connected wallet state
  • you want the complete built-in UX: wallet selection, token picker, amount entry, and confirmation
  • you want to reach production with the shortest integration path
If you already own wallet connection through Wagmi, RainbowKit, or a custom adapter, use the host wallet pattern instead.
The widget does not accept a hooks field, so destination contract calls are not available through it. To deposit into a contract on the destination chain, use the headless core or the REST API. See vault destinations.

Setup

1

Install the SDK

The SDK requires React 18.2+ or 19.
2

Define your config

Create a TrustwareConfigOptions object. At minimum you need apiKey and routes.toChain / routes.toToken.
autoDetectProvider: true tells Trustware to manage wallet discovery on its own. Leave this enabled when using the drop-in pattern.
3

Render the provider and widget

Wrap a component with TrustwareProvider and place TrustwareWidget anywhere inside it.
TrustwareProvider initializes the SDK, runs wallet detection, and makes configuration available to the widget. You do not need to pass anything else.

Widget flow

Once rendered, the widget walks users through these steps in order:
  1. Home: entry point; users choose to pay with crypto or fiat
  2. Select Token: all routable assets in the connected wallet are displayed for the transaction
  3. Confirm Deposit: amount entry with slider, token carousel, and fee summary
  4. Processing: transaction submitted; the widget waits for confirmation
  5. Success / Error: final result screen

When to prefer this pattern

The drop-in widget is the right default for most new integrations. If you find yourself needing to control the wallet, open the widget programmatically, or build custom deposit UI, look at the other integration patterns.