Privy
Privy isn’t a wallet itself, but serves as an essential wallet infrastructure that can be integrated seamlessly into any application. Its primary function is to offer more tailored flows for decentralized applications (dApps) or even blockchain wallets alike, solving the user onboarding and key management problem.
Users can easily login with a number of different platforms such as Twitter or Google mail. An Etherspot smart contract wallet is then created for them and they are ready to interact with your dapp.
Start by installing the Privy packages:
We’ll take a look at two files here, index.js and App.js
To use Privy in production you will need to request an appId.
For testing purposes you can use their test appId like we do in this tutorial.
index.js
Here we import the Privy Provider component and add some values.
Wallets are not created by default for social logins so we must set createPrivyWalletOnLogin to true.
App.js
In this file we’ll import both the Privy and Etherspot hooks we need, and return them below. Once we have logged in via Privy, we’ll pass the provider which is obtained from the Privy wallet, and use this to generate our Etherspot smart contract account.