Skip to main content

Overview

LI.FI Widget v4 introduces a modular provider architecture, internal routing improvements with TanStack Router, and enhanced multi-ecosystem support for Ethereum, Solana, Bitcoin, Sui, and Tron chains. This guide covers all breaking changes and migration steps.

What’s new in v4

Beyond the breaking changes below, v4 adds:
  • Modular providers — Install only @lifi/widget-provider-* packages for the ecosystems you need; the core widget no longer bundles wallet stacks.
  • TanStack Router — In-widget navigation uses TanStack Router instead of react-router compatibility layers.
  • wagmi v3 — Ethereum flows align with wagmi and @wagmi/core v3 when using @lifi/widget-provider-ethereum.
  • Tron (TVM) — Full Tron support via @lifi/widget-provider-tron and matching Widget Light handlers.
  • Widget Light — Continued improvements to the iframe integration surface (configuration, events, multi-chain handlers).
To get started, install the latest version of Widget.

Provider Architecture (biggest change)

New Provider Packages

Widget v4 introduces a modular provider system. Instead of the widget internally creating all wallet providers, you now explicitly install and configure only the provider packages you need: Additional supporting packages:

Core Widget Peer Dependencies Changed

Widget v3 core had blockchain-specific peer dependencies: wagmi ^2, @bigmi/react, @mysten/dapp-kit, @solana/wallet-adapter-react. Widget v4 core only requires: react >=19, react-dom >=19, @tanstack/react-query >=5.90.0. Blockchain-specific peer dependencies are now on the individual provider packages.

Configuring Providers

Widget v3 - Dependencies installed separately, providers detected automatically:
Widget v4 - Use the new providers config option:
If you only need EVM support, you only install @lifi/widget-provider-ethereum:

EthereumProvider Configuration

Wallet connector options have moved from walletConfig to EthereumProvider: Widget v3:
Widget v4:

Wagmi v2 to v3

Widget v4 requires Wagmi v3 (was v2 in Widget v3). If you use an external Wagmi setup, you must upgrade Wagmi to v3. See the Wagmi v3 migration guide for details.

Sui Package Change

The Sui peer dependency changed from @mysten/dapp-kit to @mysten/dapp-kit-react ^2.0.0:
Update any imports in your code accordingly.

Import Changes

Moved Exports

Several exports have moved to new packages:

Renamed Hooks

useWidgetChains takes a WidgetConfig parameter (used to create an SDK client for fetching chains).

Wallet Configuration

Updated WidgetWalletConfig

The wallet configuration interface has been simplified. Connector-specific options (walletConnect, coinbase, metaMask, baseAccount, porto) have moved to EthereumProvider: Widget v3:
Widget v4:

disableMessageSigning Moved

disableMessageSigning has moved from sdkConfig.executionOptions to the EthereumProvider configuration:

SDK Execution Options

sdkConfig.executionOptions has been reduced. disableMessageSigning and getContractCalls were removed. Only updateTransactionRequestHook remains:

Routing Changes

Internal Router Migration

Widget v4 uses TanStack Router internally instead of React Router v6. This is an internal change that should not affect most integrations. If you’re using React Router in your app: No special configuration is needed. The widget’s internal router is completely isolated. Widget v3 - Required catch-all route:
Widget v4 - No special route configuration:

Navigation route names have been updated:
transactionHistory was removed entirely and merged into activities.

WidgetConfig Changes

Subvariant Renamed to Mode

subvariant is now mode, and subvariantOptions is now modeOptions. All related types have been renamed:

Custom Mode Options Restructured

The custom mode option is now an object with a type field. The 'fund' value has been removed:

Wide Variant Chain Sidebar Moved to HiddenUI

The chain sidebar option has moved from modeOptions to hiddenUI:

UI Controls Changed from Arrays to Objects

disabledUI, hiddenUI, and requiredUI now use object configs instead of enum arrays:
The DisabledUI, HiddenUI, and RequiredUI enums have been replaced by DisabledUIConfig, HiddenUIConfig, and RequiredUIConfig interfaces.

useRecommendedRoute Renamed to showSingleRoute

Top-level fee Removed

The top-level fee shorthand has been removed. Use feeConfig.fee instead:

SDK Route Options Restricted

fee, referrer, order, and slippage can no longer be passed through sdkConfig.routeOptions. Use the top-level config fields (feeConfig, referrer, routePriority, slippage) instead.

Split Mode Options Enhanced

The split mode now supports an object form with defaultTab:

Event Changes

Event Bus Migrated to eventemitter3

The internal event bus has migrated from mitt to eventemitter3. Event type signatures now use callback functions:
The on/off subscription API remains the same — this change only affects custom type declarations.

WalletConnected Event Moved

The walletConnected event has moved from WidgetEvents to WalletManagementEvents in the @lifi/wallet-management package. The event type also changed — all fields are now required and two new fields were added:

TokensReversed Event Removed

WidgetEvent.TokensReversed has been removed entirely.

RouteExecutionUpdate Type Changed

The RouteExecutionUpdate type now uses action (type ExecutionAction) instead of process (type Process):
Update any event handlers that access the process property:

ReviewTransactionPageEntered Deprecated

WidgetEvent.ReviewTransactionPageEntered is deprecated. Use WidgetEvent.PageEntered instead, which fires for all page navigation with a NavigationRouteType payload.

SDK v4 Dependency

Widget v4 depends on LI.FI SDK v4, which has its own breaking changes:
  • createConfig is now createClient
  • Process type is now ExecutionAction
These changes primarily affect the event types as noted above. If you use the SDK directly alongside the widget, consult the SDK migration guide.

Quick Migration Checklist

  1. Update packages: Install @lifi/widget v4 and the provider packages you need
  2. Add providers to config: Pass EthereumProvider(), SolanaProvider(), etc. via config.providers
  3. Move wallet connector config: Move walletConnect, coinbase, etc. from walletConfig to EthereumProvider({...})
  4. Move disableMessageSigning: From sdkConfig.executionOptions to EthereumProvider({ disableMessageSigning: true })
  5. Update Wagmi to v3 if using an external Wagmi setup
  6. Update Sui package: Replace @mysten/dapp-kit with @mysten/dapp-kit-react
  7. Update useAvailableChains: Replace with useWidgetChains(widgetConfig)
  8. Update useSyncWagmiConfig import: From @lifi/wallet-management to @lifi/widget-provider-ethereum
  9. Update createDefaultWagmiConfig import: From @lifi/wallet-management to @lifi/widget-provider-ethereum
  10. Rename subvariantmode and subvariantOptionsmodeOptions
  11. Update custom mode options: Change custom: 'checkout' to custom: { type: 'checkout' }
  12. Move chain sidebar config: From subvariantOptions.wide.disableChainSidebar to hiddenUI: { chainSidebar: true }
  13. Update UI controls to object configs: Replace disabledUI: [DisabledUI.X] with disabledUI: { x: true }, same for hiddenUI and requiredUI
  14. Rename useRecommendedRouteshowSingleRoute
  15. Replace top-level fee with feeConfig: { fee: 0.03 }
  16. Remove fee/referrer/order/slippage from sdkConfig.routeOptions: Use top-level config fields instead
  17. Fix event handlers: Replace update.process with update.action in route execution event handlers
  18. Remove TokensReversed event: If subscribed, remove the handler
  19. Update walletConnected event: Now in WalletManagementEvents, not WidgetEvents
  20. Update navigation routes: Replace activeTransactions/transactionHistory with activities
  21. Remove 'fund' custom mode: If used, replace with 'checkout' or 'deposit'
  22. Remove React Router catch-all: No longer needed for widget routes