Skip to main content
The React SDK shipped a wagmi connector (@dynamic-labs/wagmi-connector) that you passed into createConfig. The JavaScript SDK ships @dynamic-labs-sdk/wagmi instead: you create your wagmi config once, with no Dynamic connector in it, then start a sync that keeps wagmi pointed at Dynamic’s selected EVM wallet account. Dynamic stays the source of truth and wagmi mirrors it, so useAccount, useSendTransaction, useReadContract, and the rest of the wagmi hooks work against Dynamic wallets.

Install

@wagmi/core (v2 or v3) and viem are peer dependencies. wagmi and @tanstack/react-query are only needed for the React helpers.

Which API to use

createDynamicWagmiConnector is the primitive the sync helpers build on. It bridges exactly one account and never follows Dynamic’s selection, so reach for it only when you deliberately want wagmi pinned to a specific account.

Create the wagmi config

Create the config once at startup. There is no Dynamic connector in it, and you never rebuild it.

Sync wagmi with Dynamic

syncDynamicWagmi subscribes to Dynamic’s wallet events and drives wagmi’s connect and disconnect whenever the selected EVM account changes (login, wallet switch, logout). It returns a function that stops the sync and tears down the connection it created.
You can start the sync before the user has a wallet: wagmi stays disconnected until an EVM wallet account is selected. If you use multiple Dynamic clients, pass the client as the second argument: syncDynamicWagmi({ config }, client). Switching the wallet wagmi points at is a Dynamic call, with no wagmi code involved:

React

SyncDynamicWagmi runs the sync for the component’s lifetime and renders nothing. Place it inside your DynamicProvider, WagmiProvider, and QueryClientProvider tree.
The hook is available directly when you prefer to run the sync yourself:

Pin wagmi to one account

To point wagmi at an account of your choosing rather than Dynamic’s selected one, build the connector yourself. The wallet provider is derived from the account, so you only pass the account.
This connector is bound to that single account and does not react to setSelectedWalletAccount. To point it elsewhere, disconnect it and connect a connector built for the other account. createDynamicWagmiConnector throws NotEvmWalletAccountError when the account is not an EVM wallet account.

What the connector supports

  • connect and disconnect
  • getAccounts, getChainId, and isAuthorized
  • switchChain
  • Forwarding Dynamic wallet events (account change, network change, disconnect) to wagmi

Alternative: skip wagmi

You do not need wagmi to work with EVM wallets in the JavaScript SDK. Enable the EVM extension and use the SDK’s functions and React hooks directly:
Last modified on September 1, 2026