Introduction to MetaMask Connect EVM
mainMetaMask Connect EVM (@metamask/connect-evm) is the modern replacement for @metamask/sdk. It allows you to connect your dapp to Ethereum and other EVM-compatible networks via the MetaMask mobile app or browser extension.
Key features include:
- EIP-1193 Compatibility: Provides a provider with the same shape as
window.ethereum, allowing existing code forviem,ethers.js, orweb3.jsto work without changes. - Automatic Platform Detection: Detects the environment (mobile vs. extension).
- Relay-based Connections: Facilitates connectivity.
- Session Persistence: Maintains user sessions.
- Convenience Methods: Includes methods like
connectAndSignandconnectWith.
Note for Multichain Developers: If your dapp supports both EVM and Solana, use the multichain client instead. The EVM and Solana clients share the same underlying multichain session, allowing the user to approve once for both.