# Single application but different organisations/clients - how to manage in NextJS

**URL:** <https://community.auth0.com/t/single-application-but-different-organisations-clients-how-to-manage-in-nextjs/174771>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [January 27, 2025, 1:22pm UTC](https://community.auth0.com/t/single-application-but-different-organisations-clients-how-to-manage-in-nextjs/174771 "2025-01-27T13:22:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin.robertson](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kevin.robertson/32/71757_2.png) [@kevin.robertson](https://community.auth0.com/u/kevin.robertson)\
**Post date:** [January 27, 2025, 1:22pm UTC](https://community.auth0.com/t/single-application-but-different-organisations-clients-how-to-manage-in-nextjs/174771/1 "2025-01-27T13:22:04Z")

</div>

Hi,

I’m looking for the best way to do the following (I’m using the NextJS SDK, the beta version):

1. Login to my application and pull ‘groups’ or ‘metadata’ of the user.
2. Map to said data

Basically, I’ve got an application where my backend has a whole heap of different customers in a single database. I want to specify logins per customer and have them route to the correct data within the database - I was going to simply use app\_metadata or organizations etc., but I’m not sure what the best method is.

I tried using both, but I was completely unsure on how to actually get that data be accessible when the user logged in - I tried pulling the ‘user’ objective from useUser, but there’s nothing usable there other than:

nickname, name, picture, email, email\_verified, sub

How can I simply add an extra hook into my logged in user? And how can I scalably configure this within auth0?

I feel like I’ve worked out a way where I could use post-login actions to go and fetch this data from some external database but that just seems like a lot of overkill; can’t I configure this within auth0?

Thanks

---

<div class="post-metadata">

**Author:** ![vigneshSivasamy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vigneshsivasamy/32/60008_2.png) [@vigneshSivasamy](https://community.auth0.com/u/vigneshSivasamy)\
**Post date:** [January 27, 2025, 4:02pm UTC](https://community.auth0.com/t/single-application-but-different-organisations-clients-how-to-manage-in-nextjs/174771/2 "2025-01-27T16:02:32Z")

</div>

Hi @kevin.robertson,

Does your application have two different URLs for two different types of users with the same API, or will both users use the same application URL?

Thanks,

---

<div class="post-metadata">

**Author:** ![vigneshSivasamy](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vigneshsivasamy/32/60008_2.png) [@vigneshSivasamy](https://community.auth0.com/u/vigneshSivasamy)\
**Post date:** [January 27, 2025, 4:04pm UTC](https://community.auth0.com/t/single-application-but-different-organisations-clients-how-to-manage-in-nextjs/174771/3 "2025-01-27T16:04:55Z")

</div>

Hi @kevin.robertson ,

If you have two different URLs for the application, you can use the organization feature. If you have the same URL, you can use organization roles (two roles within the same organization). Let me know how your application works, and I can help you set it up.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 26, 2025, 3:52pm UTC](https://community.auth0.com/t/single-application-but-different-organisations-clients-how-to-manage-in-nextjs/174771/4 "2025-02-26T15:52:29Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
