auth0/nextjs-auth0/skills
Auth0 Next.js integration
Guides coding agents through Auth0 authentication setup in Next.js App Router and Pages Router projects, including sessions, access tokens, protected routes, and step-up MFA.
What Auth0 Next.js integration does
This skill guides a coding agent through adding @auth0/nextjs-auth0 v4 authentication to a Next.js application. It supports App Router and Pages Router projects. The instructions start by checking the Next.js project and Auth0 application, then installing the SDK and configuring environment variables. These include the Auth0 domain, client ID, client secret, session secret, and application URL. An optional Auth0 CLI workflow can create or select an application.
The agent checks whether the project uses a src/ directory before creating an Auth0Client instance. It adds middleware or a proxy to mount the login, logout, callback, and profile routes. The examples use useUser() for client-side user state, getSession() for server-side authentication checks, and getAccessToken() for API requests. They also cover protecting pages and API routes. An optional Auth0Provider supplies initial user data during server rendering.
The resulting project has the code patterns needed for login, logout, session handling, and server-side access control. The instructions finish with a local authentication test. Separate sub-skills cover MFA step-up, Auth0 Organizations for business applications, and passkey registration and sign-in. The install command copies the skill folder into .claude/skills manually. The application still needs the @auth0/nextjs-auth0 SDK package.
Install
git clone https://github.com/auth0/nextjs-auth0.git && mkdir -p .claude/skills && cp -r nextjs-auth0/skills .claude/skills/nextjs-auth0Read the security check below before you run it. The repository's own instructions win if they differ.
Security check
What the skill's files do, from reading them. A flag that nobody has checked yet says "Not checked", never "No".
- Runs scripts
- No
- Uses the network
- Yes
- Installs hooks
- No
- Asks for secrets
- Yes
The scan found no bundled executable scripts or installed hooks. It flags network access and required secrets. The repository ships no skill installer, so the command clones the repository and copies its skills folder into .claude/skills manually. The optional CLI setup contains shell commands that can download and run an Auth0 CLI installer, contact Auth0, and append credentials to .env.local or .env. An agent following the instructions may also modify authentication code, middleware, and route handlers. Review the commands, installer URL, and proposed file changes before execution. Start in a test repository. The skill requires explicit confirmation before writing environment files and warns against exposing their contents or committing secrets to version control.
Scan details: SKILL.md mentions an API key, token or secret variable. SKILL.md instructions include web requests or URLs to fetch. Checked at commit 3971328adcf5.
Use cases
- Add Auth0 login and logout to Next.js applications.
- Protect server-rendered pages and API routes with session checks.
- Retrieve access tokens for authenticated API requests.
- Implement MFA step-up, organization login, or passkeys using the included sub-skills.
Limitations
- Requires Next.js 14.2.35 or later and a configured Auth0 application.
- Not intended for client-only React applications, React Native, or non-Next.js frameworks.
- Not intended for stateless APIs that only require JWT validation.
- The repository ships no skill installer. The skill folder must be copied manually, and the SDK installed separately.
Sources
- nextjs-auth0 skill folderRepositoryPrimarygithub.com
- auth0/nextjs-auth0RepositoryPrimarygithub.com
- raw.githubusercontent.com/auth0/nextjs-auth0/3971328adcf52850992e760d0c68615b49d4a685/skills/SKILL.mdWeb
- raw.githubusercontent.com/auth0/nextjs-auth0/3971328adcf52850992e760d0c68615b49d4a685/skills/mfa/SKILL.mdWeb
- raw.githubusercontent.com/auth0/nextjs-auth0/3971328adcf52850992e760d0c68615b49d4a685/skills/organizations/SKILL.mdWeb
- raw.githubusercontent.com/auth0/nextjs-auth0/3971328adcf52850992e760d0c68615b49d4a685/skills/passkeys/SKILL.mdWeb


