
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
@metamask/connect-evm
Advanced tools
@metamask/connect-evmEIP-1193 compatible interface for connecting to MetaMask and interacting with Ethereum Virtual Machine (EVM) networks.
@metamask/connect-evm provides a modern replacement for MetaMask SDK V1, offering enhanced functionality and cross-platform compatibility. It wraps the Multichain SDK to provide a simplified, EIP-1193 compliant API for dapp developers.
preferredOpenLink optionyarn add @metamask/connect-evm
or
npm install @metamask/connect-evm
import { createEVMClient } from '@metamask/connect-evm';
// Create an SDK instance
const sdk = await createEVMClient({
dapp: {
name: 'My DApp',
url: 'https://mydapp.com',
},
});
// Connect to MetaMask
await sdk.connect({ chainId: 1 }); // Connect to Ethereum Mainnet
// Get the EIP-1193 provider
const provider = await sdk.getProvider();
// Request accounts
const accounts = await provider.request({
method: 'eth_accounts',
});
import { createEVMClient } from '@metamask/connect-evm';
const sdk = await createEVMClient({
dapp: {
name: 'My DApp',
url: 'https://mydapp.com',
},
});
// Connect with default chain (mainnet)
const { accounts, chainId } = await sdk.connect();
// Connect to a specific chain
await sdk.connect({ chainId: 137 }); // Polygon
// Connect to a specific chain and account
await sdk.connect({ chainId: 1, account: '0x...' });
When using @metamask/connect-evm in React Native, the standard browser deeplink mechanism (window.location.href) doesn't work. Instead, you can provide a custom preferredOpenLink function via the mobile option to handle deeplinks using React Native's Linking API.
import { Linking } from 'react-native';
import { createEVMClient } from '@metamask/connect-evm';
const sdk = await createEVMClient({
dapp: {
name: 'My React Native DApp',
url: 'https://mydapp.com',
},
api: {
supportedNetworks: {
'eip155:1': 'https://mainnet.infura.io/v3/YOUR_KEY',
},
},
// React Native: use Linking.openURL for deeplinks
mobile: {
preferredOpenLink: (deeplink: string) => {
Linking.openURL(deeplink).catch((err) => {
console.error('Failed to open deeplink:', err);
});
},
},
} as any); // Note: mobile option is passed through to connect-multichain
The mobile.preferredOpenLink option is checked before falling back to browser-based deeplink methods, making it the recommended approach for React Native applications.
const provider = await sdk.getProvider();
// Send transaction
const txHash = await provider.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: '0x...',
value: '0x...',
},
],
});
// Call contract method
const result = await provider.request({
method: 'eth_call',
params: [
{
to: '0x...',
data: '0x...',
},
],
});
Check out the playground examples for a complete React implementation.
This package is written in TypeScript and includes full type definitions. No additional @types package is required.
This package is part of the MetaMask Connect monorepo. From the repo root:
# Run linting
yarn workspace @metamask/connect-evm run lint
# Run type checking
yarn workspace @metamask/connect-evm run check
# Format code
yarn workspace @metamask/connect-evm run format:fix
# Run tests
yarn workspace @metamask/connect-evm run test
This package is part of a monorepo. Instructions for contributing can be found in the monorepo README.
MIT
FAQs
EVM Layer for MetaMask Connect
The npm package @metamask/connect-evm receives a total of 193 weekly downloads. As such, @metamask/connect-evm popularity was classified as not popular.
We found that @metamask/connect-evm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.