Single Codebase for different domains. Multiple vs. Single Prismic Repo?: Quick reply appreciated!


We need to make a decision shortly on the best way to go about creating websites for new markets based off of our current website.

  • Current setup. We have one Gatsby codebase that we are in the progress of migrating to Next.js, because of the better integration with Prismic.

  • We also want to create a website for a new domain / country from the single code base, but with different content.

We are wondering what Prismic's recommendation for that is?
I did see this post from a Prismic Education member recommending separate Prismic repositories per website.

However our main concern is that we always need custom types to be in sync, for analytics and other reasons, and Prismic doesn't have the write API to make changes to custom types programatically.

And our content management team had concerns with organizing content in a single Prismic repository with several markets/ domains.

So if a Prismic member could recommend there best approach for

  • Single Code Base
  • Separate Website Builds with different content for different markets/domains.
  • Custom types must always be in sync.

Thank you in advance

Hello Brandon thanks for reaching out!

Custom types must always be in sync.:
At the moment there's no way to automatically keep the Custom types in sync between repositories, so it is something that you'll need to do manually:

Separate Website Builds with different content for different markets/domains:
Our recommendation is that is better to have two separate repositories rather than 1 that is shared between multiple apps, so that the Documents are independent and if you or your team ever make an unexpected change in the Custom types you don't need to worry about breaking other apps

Single Code Base:
Take a look at this Next.js thread where they discuss code sharing, this proposes to have a shared library between projects which sounds like a good solution.

npm install --save next-transpile-modules

Thanks for the reply!
I did see there is some push or write API functionality in progress with Slice Machine.
Do you see any possibility for updating custom types in Prismic programatically in the near future?

Having the possibility of managing Slices in Custom Types programmatically is kind of like the way The Slice Builder already works. Because this allows you to modify your Slices in one place and after pushing your changes to Prismic and to Storybook you update these Slices everywhere in your project, you only need to template new fields.

1 Like

This issue has been closed due to inactivity. Flag to reopen.