Example of using next.js, nextauth.js and typescript for both anonymous sessions and authenticated sessions
- First install the repo
npm install npm run gen-secret - Set up
.env.localusing placeholders from.env.local.template- Include the
NEXTAUTH_SECRETgenerated above - Transpose credentials from your (already created) GitHub App
- Include the
- Run locally
npm run dev - Open a browser to http://localhost:3000
- Click
Sign inbutton- View logs to see
GitHub signInevent
- View logs to see
- Click
Sign outbutton- View logs to see
GitHub signOutandAnonymous signInevents
- View logs to see