Socket
Book a DemoInstallSign in
Socket

@metamask/sdk

Package Overview
Dependencies
Maintainers
3
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/sdk

latest
Source
npmnpm
Version
0.34.0
Version published
Weekly downloads
210K
-9.52%
Maintainers
3
Weekly downloads
 
Created
Source

MetaMask SDK

The MetaMask SDK enables developers to easily connect their dapps with a MetaMask wallet (Extension or Mobile) no matter the dapp environment or platform.

The MetaMask SDK is a library that can be installed by developers on their projects and will automatically guide their users to easily connect with a MetaMask wallet client. For instance, for dapps running on a desktop browser, the SDK will check if Extension is installed and if not it will prompt the user to install it or to connect via QR code with their MetaMask Mobile wallet. Another example, for native mobile applications, the SDK will automatically deeplink into MetaMask Mobile wallet to make the connection.

The MetaMask SDK instance returns a provider, this provider is the ethereum object that developers are already used to which is here. This provider will now be available for:

Getting Started

The following code examplifies importing the SDK into a javascript-based app. For other languages, check the sections bellow.

Install the SDK:

yarn add @metamask/sdk
or
npm i @metamask/sdk

Import the SDK (for possible parameters check this):

import MetaMaskSDK from '@metamask/sdk'
const ethereum = new MetaMaskSDK({})

Use the SDK:

ethereum.request({method: 'eth_requestAccounts', params: []})

Bundle Types

The MetaMask SDK provides different bundles optimized for various environments:

Browser Bundle

  • Usage: For web applications running in browsers
  • Import Path: @metamask/sdk/browser
  • Format: ES Modules
  • Example:
import MetaMaskSDK from '@metamask/sdk/browser';

React Native Bundle

  • Usage: For React Native mobile applications
  • Import Path: @metamask/sdk/react-native
  • Format: ES Modules
  • Example:
import MetaMaskSDK from '@metamask/sdk/react-native';

Node.js Bundle

  • Usage: For Node.js server-side applications
  • Import Path: @metamask/sdk/node
  • Formats: Both CommonJS (require) and ES Modules (import)
  • Example:
// ESM
import MetaMaskSDK from '@metamask/sdk/node';

// CommonJS
const MetaMaskSDK = require('@metamask/sdk/node');

The SDK will automatically select the appropriate bundle based on your environment, but you can explicitly choose a specific bundle using the paths above.

Follow the full documentation

Please access this to read the MetaMask SDK full documentation

Contacts

Contact the MetaMask SDK team for a complimentary design optimization workshop here

FAQs

Package last updated on 14 Nov 2025

Did you know?

Socket

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.

Install

Related posts