Rainbowkit is a popular wallet adapter library built on Wagmi. That said, it has several limitations in terms of flexibility, customizability etc. As your company scales, it makes sense to explore transitioning to Dynamic for wallet auth. In this guide, we’ll cover how you can quickly swap out Rainbowkit for Dynamic.Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
A few notes
- Rainbowkit uses wagmi for all functions. Dynamic can leverage wagmi as well, requiring a quick connector to coordinate between the libraries.
- Rainbowkit requires that you manage your own authentication. Dynamic, on the other hand, comes with auth built in and will return a JWT if you select the connect and auth option.
Overview
To start, we will assume your current setup looks similar to this:- Ethers.js
- Wagmi
- Rainbowkit
Step 1: Set up the Dynamic SDK
Shell
📘 Note: Dynamic comes with ethers.js as part of its package, meaning you can remove any independent ethers.js installation.You can read the full Dynamic set up guide here.
Step 2: Set up the Dynamic Wagmi connector
Shell
Step 3: Configure Dynamic instead of Rainbowkit
Replace RainbowKitProvider with DynamicContextProvider
📘 Note: you’ll need to grab a Dynamic environment ID from your developer dashboardFirst, we will swap out the Rainbowkit provider with the Dynamic one.
Replace WagmiConfig with DynamicWagmiConnector
As mentioned in the full wagmi guide above, the DynamicWagmiConnector replaces wagmiConfig in the Dynamic setup. Note that the Dynamic provider wraps the Wagmi connector, vs wagmi wrapping the Rainbowkit adapter.