# Using nextjs-auth0 v4 in a multi-tenant app

**URL:** <https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313>\
**Category:** Dev to Dev Hub\
**Tags:** sdks-quickstarts, nextjs-auth0\
**Created:** [March 4, 2025, 6:20pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313 "2025-03-04T18:20:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccarse](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ccarse/32/61324_2.png) [@ccarse](https://community.auth0.com/u/ccarse)\
**Post date:** [March 4, 2025, 6:20pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313/1 "2025-03-04T18:20:15Z")

</div>

I’m building a multi-tenant app based on vercel’s platforms example: github/vercel/platforms I’m struggling getting nextjs-auth0 to work. I’d like a single session that is shared across subdomains but haven’t been able to get that to work. Do you have any documentation on using v4 in a multi-tenant scenario like this? Thanks.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 5, 2025, 6:04pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313/3 "2025-03-05T18:04:16Z")

</div>

Hi @ccarse

Welcome to the Auth0 Community!

I am sorry about the delayed response to you inquiry.

If you are looking to have SSO between multiple tenants and multiple application’s, that can be hard to accomplish. Auth0 does not offer an out-of-the-box solution regarding integrating multi-tenant SSO with multiple applications. SSO is intended to work between applications inside a single tenant because the user accounts and sessions would be shared only within the tenant.

Otherwise, if you are using a connection like SAML, you can have an Auth0 tenant as an SP and another one acting as the IdP. This way, you will accomplish an multi-tenant SSO using 2 tenants and 2 applications which have the connection enabled. You can read more about that in our [documentation](https://auth0.com/docs/authenticate/protocols/saml/saml-configuration/configure-auth0-as-service-and-identity-provider?_gl=1*12gndrt*_gcl_aw*R0NMLjE3Mzk5MTIzNjEuQ2owS0NRaUFfTkM5QmhDa0FSSXNBQlNuU1RZTnptMWN2S3hiOHlWNGpfRTlHbk1JYkJWUzYtcG1NZlVfODFXV1NsSVBHaUJZT0FrSEh2RWFBa2FpRUFMd193Y0I.*_gcl_au*MTQ0Mjc1NzMyLjE3MzM4NDI0MjM.*_ga*MTUzMjkzMjI3NS4xNzMzODM0NTky*_ga_QKMSDV5369*MTc0MTEwNDQxNS4xOTEuMS4xNzQxMTE2NzAwLjU4LjAuMA).

You can also read more about multi-tenancy [here](https://auth0.com/docs/get-started/auth0-overview/create-tenants/multi-tenant-apps-best-practices).

If you have any other questions, feel free to leave a reply!

Kind Regards.  
Nik

---

<div class="post-metadata">

**Author:** ![ccarse](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ccarse/32/61324_2.png) [@ccarse](https://community.auth0.com/u/ccarse)\
**Post date:** [March 5, 2025, 6:11pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313/4 "2025-03-05T18:11:04Z")

</div>

When I say multi tenant app I’m not talking about how auth0 uses that terminology I’m using how vercel uses that terminology in their platforms example. So, we have a single next.js app hosted at a root domain and each of our users have their own subdomain at which they use the site.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 6, 2025, 8:10pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313/5 "2025-03-06T20:10:44Z")

</div>

Hi again,

Thank you for the extra info, sorry about the confusion.

I will investigate regarding Auth0 NextJS and Vercel scenario. I will come back with an update as soon as possible. In the meantime, I believe the following resources might be helpful regarding the matter:

- [How to Build a Multi-Tenant App with Custom Domains Using Next.js](https://vercel.com/guides/nextjs-multi-tenant-application)
- [Set up your multi-tenant app with Vercel & Auth0](https://www.youtube.com/watch?v=aU9DWD1RLiM)
- [New Auth0 Integration for Vercel: Available Now](https://auth0.com/blog/auth0-vercel-integration/)
- [NextJS Auth0 SaaS Starter](https://vercel.com/templates/next.js/auth0-nextjs-saas-starter)
- [How to Deploy a React App Secured By Auth0 to Vercel](https://developer.auth0.com/resources/guides/spa/react/vercel-deployment)

If you have any other questions, feel free to let me know!

Kind Regards,  
Nik

---

<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:** [March 20, 2025, 8:11pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313/6 "2025-03-20T20:11:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![remus.ivan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/remus.ivan/32/68771_2.png) [@remus.ivan](https://community.auth0.com/u/remus.ivan)\
**Post date:** [September 5, 2025, 8:36pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313/7 "2025-09-05T20:36:21Z")

</div>


