This is one of the breaking changes we’re making in Q1 2020. Click here for more details.
In Q1 2020, MetaMask will no longer inject the
web3.js API. You can still bring your own web3.js or similar library and use it with MetaMask. We will simply stop injecting a particular version of web3.js for you.
We’ve primarily included web3.js as a convenience alongside MetaMask’s core Ethereum provider API, which wraps the JSON-RPC API and is documented here.
Removing web3.js is part of an effort to simplify MetaMask’s API and provide the safest, most stable experience possible.
Why are we doing this? What does this mean for you?
MetaMask currently injects
email@example.com, which is no longer receiving fixes or updates. The
0.20.x version also lacks some safety validations that have caused trouble for our users.
While upgrading web3.js to
1.0.x is an option, the upgrade would require breaking changes.
firstname.lastname@example.org is already a scheduled breaking change, so rather than subject our users to a series of breaking changes, we are finally putting version choice firmly in the hands of developers so we can minimize the number of breaking changes in the future.
You can still bring your own convenience library and use it with the MetaMask inpage provider, whether ethers.js, web3.js, or something else.
Removing our injected version of web3.js will help us continue to provide a safe, performant experience for developers while managing our maintenance costs. In Q1 2020, dapps will have to bring their own convenience library of they want to use one.