This sample project demonstrates how to use the Auth0 My Organization API within a Next.js application.
For a detailed walkthrough on building this application, please refer to the Auth0 Blog.
⚠️ This project is intended for demonstration purposes only and is not meant for production use.⚠️
To set up and run this sample project, you will need:
- Node.js 18.x or later
- npm, yarn, or pnpm package manager
- An Auth0 Account
Follow these steps to get the application running locally:
-
Follow the blog to setup Organizations feature on your Auth0 tenant
-
Clone the repository from GitHub:
git clone https://github.com/oktadev/nextjs-my-org-api.git
-
Navigate into the project directory and install dependencies:
cd nextjs-my-org-api npm install -
Create a
.env.localfile in the root directory and add your configuration variables as described in the article.AUTH0_DOMAIN='<your-auth0-domain>' AUTH0_CLIENT_ID='<your-auth0-client-id>' AUTH0_CLIENT_SECRET='<your-auth0-client-secret>' # Run `openssl rand -hex 32` in your terminal to generate a random 32-byte hex string AUTH0_SECRET='<your-random-32-byte-hex-string>' APP_BASE_URL='http://localhost:3000'
-
Start the development server:
npm run dev -
The Application will be available at
http://localhost:3000/.
Copyright 2026 Okta, Inc.
This project is licensed under the Apache License 2.0. See the LICENSE file for more info.