Config to the Widget. The Widget adopts that config verbatim, so the account, connectors, chains, transports, signer, and connection lifecycle remain owned by your app.
Pass the same config
wagmi is an optional, types-only peer of @layerswap/widget-react. Your application still installs and initializes wagmi normally.
Include every chain the Widget needs
The Widget does not append Layerswap chains or transports to a host config. Add every EVM chain that users should select or switch to:wagmi.ts
wagmiConfig on the first Widget render. A config supplied after initialization is ignored with a console warning. Because the host owns hydration and reconnect behavior, keep the Widget under the same WagmiProvider and query client as the rest of your app.
Avoid duplicate injected wallets
wagmi v2 discovers EIP-6963 wallets by default. Declaring a genericinjected() connector as well can show the same extension twice after reconnect. Either rely on discovery or set multiInjectedProviderDiscovery: false when you intentionally manage one generic connector. See Troubleshooting.
Notes
- If
walletProvidersConfigexcludesevm, the Widget ignoreswagmiConfig. - Add custom transport RPC endpoints to the CSP
connect-src. - The JavaScript loader does not accept
wagmiConfig; this sharing path is React-only.