Skip to main content

Custom connectors

Add custom connectors for Ethers or Wagmi

If you already have Wagmi integrated into your application or would like more control over Wagmi's configuration, you can integrate AppKit on top of it.

import { createWeb3Modal } from '@web3modal/wagmi'

import { reconnect, http, createConfig } from '@wagmi/core'
import { sepolia } from '@wagmi/core/chains'
import { walletConnect } from '@wagmi/connectors'

const projectId = 'YOUR_PROJECT_ID'

const metadata = {
//...
}

const config = createConfig({
chains: [sepolia],
transports: {
[sepolia.id]: http()
},
connectors: [
walletConnect({ projectId, metadata, showQrModal: false }), // showQrModal must be false.
//other connectors...
]
})
reconnect(config)

const modal = createWeb3Modal({
//...
wagmiConfig: config,
})