How can I connect to multiple repositories in a Next.js project?

I am working with an existing Next.js project that is connected to a repo using the following package versions:

  • "@prismicio/client": "^6.0.0",
  • "@prismicio/helpers": "^2.3.9",
  • "@prismicio/next": "^1.0.3",
  • "@prismicio/react": "^2.0.0",

I am tasked with updating multiple pages, but not all of them. For the pages I need to update, I would like to update to the newest version of the packages so I can make use of the slicemachine. Do you have a guide that explains how that can be accomplished? Surely, there must be a way to incrementally switch over to a new repo. Please help!

Hello @chris9

Welcome to the Prismic community, and thanks for reaching out to us.

If I understood your question correctly, you want to update and migrate your project to the latest version of Prismic/client. I'd recommend you follow the migration guide: @prismicio/client v7 Migration Guide - Documentation - Prismic

I believe you might want to migrate your repo from Legacy Builder to Slice Machine repo. So, I'd like to let you know that there is no official guide for migrating from the Legacy Builder to Slice Machine. This can make the process difficult as there may be confusing and breaking changes we cannot avoid now.

As a result, we recommend that users either continue using the Legacy Builder for older websites and select Slice Machine for newer projects or attempt to manually create an identical copy of the older repository if they wish to use it for more senior projects. We understand that this process can be pretty time-consuming and not ideal, but it's the best option for avoiding content loss.

Connect to Multiple repositories in one Next.js project:
Our recommendation is that it is better to have multiple separate repositories rather than one 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

I hope I understood your question well and addressed it accordingly. If there is something else you are looking for, please elaborate more so I can provide you with proper guidance.