Multi Tenancy App and Incremental Static Generation #17260
-
|
I'm trying to build a multi tenant app, so differents websites will be served by the same app, and depending on the hostname different data will be fetched (like metatags,css and so on) I know this can be achieved using The main problems here are 2: The only solution i can see is build pages urls as follow So my question is : can somehow |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 36 replies
-
|
Update: we recently launched the Platforms Starter Kit that's a comprehensive template for building multi-tenant applications with built-in custom domains support + ISR. We also removed the 50 custom domain limit for all Pro teams on Vercel. Try with:
In every page you can provide the list of known hostnames and pre-render based on that. |
Beta Was this translation helpful? Give feedback.
-
|
This is a blocker for us moving to Next, since changing url structure makes no sense in our case. If we could get the hostname in |
Beta Was this translation helpful? Give feedback.
-
|
What is the current status of multi tenancy in NextJs without being dependent on a Custom Server? Are there plans on building this functionality? |
Beta Was this translation helpful? Give feedback.
-
|
Update: we recently launched the Platforms Starter Kit that's a comprehensive template for building multi-tenant applications with built-in custom domains support + ISR. We also removed the 50 custom domain limit for all Pro teams on Vercel. As mentioned in previous comments above, this is a great example of multi-tenancy using SSR + caching: https://multi-domain-first.vercel.app/. Another example is http://static.fun/. As this comment shows, you can use ISR, it just depends on your use case (e.g. how you want your URLs structured). |
Beta Was this translation helpful? Give feedback.
-
|
As we're in the process of converting part of our app (public facing websites) to next.js I wanted to share a bit what I learned around multi-tenancy in next.js so far:
Specific codebases I found that do something related:
Our approach in short is:
|
Beta Was this translation helpful? Give feedback.
-
|
If that could help, I developed an Express.js middleware for achieving multi-tenancy with Next.js: https://github.com/micheleriva/krabs. I'm studying how to deploy +200 sites this way, so feel free to reach out if you have more questions! |
Beta Was this translation helpful? Give feedback.
-
|
interesting approach #12848 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
Hi guys, cross-posting here from the more generic ticket about Multi-tenancy that I've opened (#20841), I've worked on a possible architecture for static (or ISR) multi-tenancy, without bloating the URL and without per-request SSR. This means Article there: https://blog.vulcanjs.org/lets-bring-the-jamstack-to-saas-introducing-rainbow-rendering-ad1834fe62ff |
Beta Was this translation helpful? Give feedback.
-
|
FYI for those of you wondering if it's possible to do this via NextJS rewrites without a separate proxy layer +
Then you should be able to static render based on host path. Note that |
Beta Was this translation helpful? Give feedback.
-
|
@nicosh Did you find any solution for your problem ? |
Beta Was this translation helpful? Give feedback.
-
|
Quick update on this – we recently launched the Platforms Starter Kit that's a comprehensive template for building multi-tenant applications with built-in custom domains support + ISR.: https://demo.vercel.pub/platforms-starter-kit Feel free to try it out and let us know what you think! :) We also removed the 50 custom domain limit for all Pro teams on Vercel. |
Beta Was this translation helpful? Give feedback.
-
|
Can someone knowledgeable help please - I have a nextjs app with multi tenancy. Problem: on inner pages (2-nd, 3-rd level etc) from time to time queries from the main page (1st level) are fired. I use apollo with cache and main page has a few queries which I fetch in getStaticProps. Any ideas, thoughts, suggestions please? |
Beta Was this translation helpful? Give feedback.

Quick update on this – we recently launched the Platforms Starter Kit that's a comprehensive template for building multi-tenant applications with built-in custom domains support + ISR.: https://demo.vercel.pub/platforms-starter-kit
Feel free to try it out and let us know what you think! :)
We also removed the 50 custom domain limit for all Pro teams on Vercel.