Rainbowkit connector
Privy makes it easy to integrate cross-app wallets from various Privy apps into existing setups with RainbowKit, ConnectKit, wagmi and more using the @privy-io/cross-app-connect
SDK.
Integrating apps do not need to use Privy themselves to integrate cross-app wallets; instead, they can import a Privy cross-app connector directly from the SDK to configure with their wallet connector library. Simply follow the instructions below to get set up!

See our privy-io/cross-app-connect-demo
repo for an example set up.
1. Install dependencies
Install the @privy-io/cross-app-connect
SDK and its peer dependencies:
2. Create the connector
Import the toPrivyWallet
connector function from @privy-io/cross-app-connect/rainbow-kit
:
Use the toPrivyWallet
method to create a wallet connector. The function takes id
, name
, and iconUrl
(described below) and returns a connector that RainbowKit will use to connect to the provider wallet.
Parameters
Privy app ID for the provider application.
The name of the Privy provider application.
The URL for the icon that will appear in the modal.
Call this method within RainbowKit’s connectorsForWallets
function like so:
Then, pass this array of connectors to your wagmi configuration.
This config
will be passed to the WagmiProvider
in the next step.
3. Wrap app with providers
At the highest level of your applications, wrap the component with the wagmi
, QueryClient
, and RainbowKit
providers. Pass the configuration you created in step 2 to the wagmi
provider.
Complete example
All together, this should look like:
4. Use the ConnectButton
Import the ConnectButton
and use to prompt users to connect to their provider Privy wallet.
Thats it! You can now use any wagmi hook in your application to interact with the connected wallet. When users connect and transact with their wallet, Privy will open a pop-up for users to authorize any actions.
Was this page helpful?