Skip to content
Docs
WagmiConfig

WagmiConfig

The WagmiConfig component manages configuration for all hooks using React Context.

import { WagmiConfig } from 'wagmi'

Usage

import { WagmiConfig } from 'wagmi'

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

Configuration

client

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

import { createClient, configureChains, defaultChains } from 'wagmi'
import { publicProvider } from 'wagmi/providers/public'

const { provider, webSocketProvider } = configureChains(defaultChains, [
  publicProvider(),
])

const client = createClient({
  provider,
  webSocketProvider,
})

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