Integrate social logins within RainbowKit through Particle Auth.
@particle-network/auth-core-modal
) or Web3-native wallet connections. This unification of social logins and external wallet connections is also possible through Particle Connect, although if you’d like to use RainbowKit, including Particle Auth within the list of connection options is simple.
particleWagmiWallet
particleWagmiWallet
alongside its respective derivatives, including particleGoogleWallet
, particleTwitterWallet
, and any other social login implementations that you’d like to include within your RainbowKit instance (through wallets
within RainbowKit’s connectorsForWallets
).
To build custom Particle Auth connectors of this nature, follow the walkthrough below.
particleWagmiWallet
connector. You’ll first need to create an additional file within your project to hold the custom connector, such as particleWagmiWallet.ts
. This file should include the below snippet:
particleGoogleWallet
). With the particleWagmiWallet
connector set up, you’ll need to establish a number of configured (derivative) connector instances to include specific social logins within your RainbowKit instance (these should be placed in the wallets
array while configuring connectorsForWallets
). An example of this is included below:
ConnectButton
instance with a social login patch. When using Particle Auth Core with RainbowKit, you’ll need to add a short snippet that fixes a few common issues that may arise when using social logins with wagmi. In our demo, we place this within the App.tsx
file, which is then rendered in place of ConnectButton
directly. Below is the snippet in question:
Demo repository available
To dive further into this process and view a practical example of implementation, take a look at the following demo repository:
1. Next.js example.
2. (create-react-app example coming soon)
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'sqrt')
.
swcMinify
within your next.config.js
file. You’ll need to switch swcMinify
from true
to false
, thus using Terser as the minifier rather than SWC.📹 A full walkthrough video on leveraging Particle Auth within RainbowKit is available.
For an extended explanation and tutorial regarding the integration of Particle Auth within RainbowKit, we’ve created a video and GitHub template repository.