Privy
Last updated
Last updated
Privy is a simple toolkit for progressive authentication in web3. With a single library, you can easily onboard both expert users and newcomers alike, through Privy's powerful wallet connectors and delightful embedded wallets.
Privy makes it easy to integrate every major wallet into your app without having to wrangle the connectors individually. You can check out Privy in action here.
Privy comes pre-packaged with Phantom so you can support your Phantom users right out of the box. Here’s how.
The Privy React Auth SDK allows you to authenticate your users with Privy in your React app in minutes. You can follow the standard guide here.
Building a new app? Check out these starter templates for integrating Privy into:
a NextJS project (GitHub, CodeSandbox)
a Create React App project (GitHub, CodeSandbox)
Request access to Privy and get keys in minutes. Retrieve your Privy app ID from the developer console at console.privy.io
Install the Privy React Auth SDK using npm
:
Once you have your app ID, in your React project, wrap your components with a PrivyProvider
. The PrivyProvider
should wrap any component that will use the Privy SDK.
If you're starting from scratch, we recommend using one of these templates to integrate Privy:
a NextJS project (GitHub, CodeSandbox)
a Create React App project (GitHub, CodeSandbox)
For example, in a NextJS or Create React App project, you may wrap your components like so:
The PrivyProvider
takes the following properties:
your appId
an optional onSuccess
callback which will execute once a user successfully logs in
an optional config
property to customize the look and feel of the Privy modal to match your app
usePrivy
! 🎉You can now use the Privy SDK throughout your app via the usePrivy
hook with Phantom working right out of the box.
See Privy run live in a CodeSandbox environment and check out the starter repo for more reference.
Customize Privy to match your brand and explore how your users are connecting to your app.
From here, you can easily use Privy to:
Prompt users to link additional accounts, as part of progressive onboarding.
Manage your user base with simple allowlists and powerful analytics.