Skip to content
Documentation
/
Connectors
/
Injected

InjectedConnector (MetaMask, etc.)

The InjectedConnector supports wallets that inject an Ethereum provider into the browser or window. The MetaMask browser extension is the most popular example of this.

import { InjectedConnector } from 'wagmi/connectors/injected'

Usage

import { InjectedConnector } from 'wagmi/connectors/injected'

const connector = new InjectedConnector()

Configuration

chains (optional)

Chains supported by app. Defaults to defaultChains.

import { defaultChains, defaultL2Chains } from 'wagmi'
import { InjectedConnector } from 'wagmi/connectors/injected'

const connector = new InjectedConnector({
  chains: [...defaultChains, ...defaultL2Chains],
})

options

Options for configuring the connector.

import { InjectedConnector } from 'wagmi/connectors/injected'

const connector = new InjectedConnector({
  options: {
    shimDisconnect: true,
  },
})