Using Auth0 with Next.js

Tadashi Shigeoka ·  Sat, March 18, 2023

I’ve built a sample application using Auth0 with Next.js, so I’d like to share it with you.

Auth0 | オースゼロ

Background - Technical Verification of Auth0 with Next.js

For technical verification purposes, I prepared a sample application using Auth0 with Next.js.

Initial Setup - npx create-next-app@latest

Sample code: npx create-next-app@latest —typescript by shige · Pull Request #1 · codenote-net/auth0-nextjs-sandbox

npx create-next-app@latest --typescript

Need to install the following packages:
  [email protected]
Ok to proceed? (y) y
✔ What is your project named? … auth0-nextjs-sandbox
✔ Would you like to use ESLint with this project? … No / Yes
✔ Would you like to use `src/` directory with this project? … No / Yes
✔ Would you like to use experimental `app/` directory with this project? … No / Yes
✔ What import alias would you like configured? … @/*

Using Auth0 with Next.js

I implemented following the official Auth0 documentation Auth0 Next.js SDK Quickstarts: Login. The following Pull Request shows the implementation:

Sample code: Integrate Auth0 with Next.js application using the Auth0 Next.js SDK by shige · Pull Request #2 · codenote-net/auth0-nextjs-sandbox

That’s all from the Gemba, building a sample application using Auth0 with Next.js.

Reference Information