@privy-io/cross-app-connect
SDK.
Integrating apps do not need to use Privy themselves to integrate cross-app wallets; instead, they can create a custom wagmi connector using the SDK to configure with ConnectKit. Simply follow the instructions below to get set up!
See our
privy-io/cross-app-connect-demo
repo’s ConnectKit branch for an example setup.1. Install dependencies
Install the@privy-io/cross-app-connect
SDK and its peer dependencies:
2. Create the custom connector
Next, you’ll create a custom wagmi connector that integrates with Privy’s cross-app-connect functionality. This connector will be fully compatible with ConnectKit and handles all the connection logic for you:privy-global-connector.ts
3. Configure wagmi with ConnectKit
Now you’ll set up your wagmi configuration using ConnectKit’sgetDefaultConfig
and pass in your custom Privy connector. This step brings everything together:
4. Wrap your app with providers
At the highest level of your application, wrap your components with theProviders
component you just created:
Complete example
Here’s how all the pieces fit together in your project structure:5. Use the ConnectKitButton
Finally, import the ConnectKitButton
and use it anywhere in your app to let users connect to their Privy global wallets: