Skip to content
Docs
/
WagmiProvider

WagmiProvider

The WagmiProvider manages configuration for all hooks using React Context (not to be confused with an ethers Provider of course).

import { WagmiProvider } from 'wagmi'

Usage

import { WagmiProvider } from 'wagmi'

function App() {
  return (
    <WagmiProvider>
      <YourRoutes />
    </WagmiProvider>
  )
}

Configuration

client (optional)

A wagmi Client instance that consists of configuration options. Defaults to createClient().

import { providers } from 'ethers'
import { WagmiProvider, createClient } from 'wagmi'

const client = createClient({
  autoConnect: true,
  provider(config) {
    return new providers.AlchemyProvider(config.chainId, 'Your Alchemy ID')
  },
})

function App() {
  return (
    <WagmiProvider client={client}>
      <YourRoutes />
    </WagmiProvider>
  )
}