This is a template for integrating Privy Auth into a NextJS project. Check out the deployed app here!
This demo uses NextJS's Pages Router. If you'd like to see an example using the App Router, just change the branch of this repository to app-router.
git clone https://github.com/BRAINCHN/privy2npm i npm install @privy-io/react-auth@latestenable localhost:3000 in the domain allow list
npm run devcp .env.example .env.local
```.env
# Add Privy App ID to .env.local
NEXT_PUBLIC_PRIVY_APP_ID=yourprivyappIDgoeshere
PRIVY_APP_SECRET=yourprivyappsecretkeygoesherenpm run devpages/_app.tsxfor how to use thePrivyProviderand initialize it with your Privy App IDpages/index.tsxfor how to use theusePrivyhook and implement a simpleloginbuttonpages/dashboard.tsxfor how to use theusePrivyhook, fields likeready,authenticated, anduser, and methods likelinkWalletandlogout
Check out our docs for more guidance around using Privy in your app!