Skip to content

auth0-blog/nextjs-my-org-api

Repository files navigation

A Next.js Sample Application for My Organization API

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. ⚠️

Requirements

To set up and run this sample project, you will need:

To run this application

Follow these steps to get the application running locally:

  1. Follow the blog to setup Organizations feature on your Auth0 tenant

  2. Clone the repository from GitHub:

    git clone https://github.com/oktadev/nextjs-my-org-api.git
  3. Navigate into the project directory and install dependencies:

    cd nextjs-my-org-api   
    npm install
  4. Create a .env.local file 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'
  5. Start the development server:

    npm run dev
    
  6. The Application will be available at http://localhost:3000/.

License

Copyright 2026 Okta, Inc.

This project is licensed under the Apache License 2.0. See the LICENSE file for more info.

About

A sample Next.js application with My Organization API for Auth0 Blog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors