Skip to main content

Connect to EVM networks

@metamask/connect-evm is the modern replacement for @metamask/sdk. Use it to connect your dapp to Ethereum and other EVM networks in the MetaMask mobile app or browser extension.

The EVM client provides an EIP-1193-compatible provider with the same shape as window.ethereum, meaning existing viem, ethers.js, or web3.js code works with minimal changes. It also includes automatic platform detection, relay-based connections, session persistence, and convenience methods like connectAndSign and connectWith.

Coming from @metamask/sdk?

See the migration guide for a step-by-step upgrade path covering package changes, API differences, and new capabilities.

Going multichain?

If your dapp supports (or plans to support) both EVM and Solana, you can use the multichain client instead. The EVM and Solana clients share the same underlying multichain session, meaning the user only approves once. See the multichain quickstart to get started.

Supported platforms and libraries

MetaMask Connect EVM supports multiple integration paths. You can install it from npm, use it through developer libraries such as Wagmi, or integrate it through supported third-party libraries.

Choose a quickstart based on your stack.

Library compatibility

The EVM client works seamlessly with popular Ethereum libraries:

LibraryCompatibility
viemUse with custom() transport
ethers.jsPass client.getProvider() to BrowserProvider
web3.jsPass client.getProvider() to Web3 constructor