
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@metamask/onboarding
Advanced tools
This library is used to help onboard new MetaMask users. It allows you to ask the MetaMask extension to redirect users back to your page after onboarding has finished.
This library will register the current page as having initiated onboarding, so that MetaMask knows where to redirect the user after onboarding. Note that the page will be automatically reloaded a single time once a MetaMask installation is detected, in order to facilitate this registration.
@metamask/onboarding is made available as either a CommonJS module, and ES6 module, or an ES5 bundle.
import MetaMaskOnboarding from '@metamask/onboarding'const MetaMaskOnboarding = require('@metamask/onboarding')dist/metamask-onboarding.bundle.js (this can be included directly in a page)See § Onboarding Library on the MetaMask Docs website for examples.
Assuming import MetaMaskOnboarding from '@metamask/onboarding', the following API is available.
MetaMaskOnboarding.isMetaMaskInstalled()Returns true if a MetaMask-like provider is detected, or false otherwise. Note that we don't provide any guarantee that this is correct, as non-MetaMask wallets can disguise themselves as MetaMask.
MetaMaskOnboarding.FORWARDER_MODEA set of constants for each of the available forwarder modes.
| Constant | Description |
|---|---|
INJECT | Inject a iframe to that will refresh until MetaMask has installed |
OPEN_TAB | Open a tab to a new page that will refresh until MetaMask has installed—this is only useful if the client app has disallowed iframes |
new MetaMaskOnboarding()The constructor accepts an optional options bag with the following:
| Option | Description |
|---|---|
forwarderOrigin | Override the forwarder URL, useful for testing. Optional, defaults to 'https://fwd.metamask.io'. |
forwarderMode | One of the available forwarder modes. Optional, defaults to MetaMaskOnboarding.FORWARDER_MODE.INJECT. |
startOnboarding()Starts onboarding by opening the MetaMask download page and waiting for MetaMask to be installed. Once the MetaMask extension installation is detected, a message will be sent to MetaMask to register the current site as the onboarding initiator.
stopOnboarding()Stops onboarding registration, including removing the injected iframe (if any).
nvm use will automatically choose the right node version for you.yarn setup to install dependencies and run any requried post-install scripts
yarn / yarn install command directly. Use yarn setup instead. The normal install command will skip required post-install scripts, leaving your development environment in an invalid state.Run yarn lint to run the linter.
The project follows the same release process as the other libraries in the MetaMask organization:
main1.x)yarn version --minor --no-git-tag-version)main or 1.x)This project is available under the MIT license.
Web3Modal is a library that allows developers to easily integrate multiple web3 wallet providers into their dApps. It provides a modal for users to select their preferred wallet, including MetaMask, WalletConnect, and others. Compared to @metamask/onboarding, Web3Modal offers a broader range of wallet options but does not focus specifically on the MetaMask onboarding process.
Web3-react is a library for connecting React applications to Ethereum wallets. It supports multiple wallet providers and offers hooks for managing wallet connections. While it provides more flexibility in terms of wallet support, it does not offer the same dedicated onboarding experience for MetaMask as @metamask/onboarding.
Use-wallet is a React hook for managing Ethereum wallet connections. It supports multiple wallet providers and offers a simple API for integrating wallet functionality into React applications. Like web3modal and web3-react, it provides broader wallet support but lacks the specific onboarding features for MetaMask found in @metamask/onboarding.
FAQs
Assists with onboarding new MetaMask users
The npm package @metamask/onboarding receives a total of 495,167 weekly downloads. As such, @metamask/onboarding popularity was classified as popular.
We found that @metamask/onboarding demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.