Configure your chains with API providers
You can use our built-in API providers to configure your chains. This way, you don't need to worry about defining RPC URLs or about passing provider instances to
RainbowKit exports a
configureChains function. This function accepts an array of chains and an array of API providers. This function returns
chains: pass this to
provider: pass this to
webSocketProvider: optionally pass this to
To use Alchemy, use the
apiProvider.alchemy provider with an Alchemy ID.
To use Infura, use the
apiProvider.infura provider with an Infura ID.
To use your own RPC URLs, use the
apiProvider.jsonRpc provider to configure chains with its RPC URLs.
To configure the chains with their respective fallback (public) RPC URLs, use the
Multiple API providers
configureChains function accepts multiple API Providers. This is useful if not all your chains support a single API provider. For example, you may want to use Alchemy for Ethereum, and avax.network for Avalanche.
If you wish to use a WebSocket provider, the
configureChains also returns a
webSocketProvider. You need to pass that to the