Sitelet https://github.com/MetaMask/inpage-provider
Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.
 
 

Repository files navigation

Caution

This package has been moved to https://github.com/MetaMask/providers

MetaMask Inpage Provider

The inpage Ethereum provider object injected by MetaMask into web pages. Contains a lot of implementation details specific to MetaMask, and is probably not suitable for out-of-the-box use with other wallets.

Installation

yarn add @metamask/inpage-provider

Usage

import { initProvider } from '@metamask/inpage-provider'

// Create a stream to a remote provider:
const metamaskStream = new LocalMessageDuplexStream({
  name: 'inpage',
  target: 'contentscript',
})

// this will initialize the provider and set it as window.ethereum
initProvider({
  connectionStream: metamaskStream,
})

const { ethereum } = window

Do Not Modify the Provider

The Provider object should not be mutated by consumers under any circumstances. The maintainers of this package will neither fix nor take responsbility for bugs caused by third parties mutating the provider object.

About

An Ethereum Provider that connects over a stream, as injected into websites by MetaMask

Resources

Code of conduct

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages