TrustwareConfigOptions is the single object you pass to TrustwareProvider. Every aspect of the SDK (which chain and token to route to, how the widget looks, how retries are handled, and which wallet connectors are available) is controlled through this shape.
apiKey is always required. In deposit mode, which is the default, a routes object containing at minimum toChain and toToken is required as well. In swap mode the user chooses both sides of the trade in the widget, so routes is optional. Everything else falls back to a sensible default.
Complete config shape
Shown for deposit mode, the default. In swap mode setmode: "swap" and routes becomes optional; everything else is identical. The SDK types this as a discriminated union on mode, shown in the types reference.
Required fields
string
required
Your Trustware API key. Used for all requests the SDK makes to the Trustware
backend. Store this in an environment variable and avoid committing it to
source control.
routes fields below are required in deposit mode, which is the default. In swap mode they are optional, because the user selects both the source and the destination in the widget. See swap mode.
string
required
The destination chain ID as a string (for example,
"8453" for Base). See
the route configuration page for the full list of
supported values.string
required
The destination token identifier: the contract address on EVM, the mint
address on Solana, or the native denom string (for example
"unibi") on
Cosmos. See route configuration for details.Config groups
Each top-level key beyondapiKey and routes is documented on its own page.
autoDetectProvider vs autoDetect: two related but distinct controls.autoDetectis a prop on<TrustwareProvider>that triggers wallet detection on mount. Defaults totrue. SetautoDetect={false}when passing your ownwallet(see host wallet) to avoid duplicate discovery.autoDetectProvideris a field insideTrustwareConfigOptionsfor headless usage. Whentrue, the core API auto-picks upwindow.ethereumwhen called directly. Defaults tofalse.
Lifecycle callbacks
(error: TrustwareError) => void
Called whenever a
TrustwareError is thrown during a route or transaction
operation. Use this to surface errors to your own UI or logging pipeline.(transaction: Transaction) => void
Called after a transaction is successfully submitted and confirmed. Receives
the completed
Transaction object.(event: TrustwareEvent) => void
Called for widget lifecycle events such as step transitions. Use this for
analytics or custom instrumentation.
