šŸ‘‹ Next.js Conf 2024: Come build, party, run, and connect with us! See all events

Connecting a new repo to a new Sanity project without building a new Sanity app

3 replies
Last updated: Jun 5, 2023
Hey! I currently have a Next.js site connected to Sanity, all living within an NX mono-repo. I need to create a new separate website with the same Sanity schemas, so I forked my repo. Now, I need to connect this new repo to a new Sanity Project. The current options to create a new Sanity Project are through the CLI or using a starter build, but I don't want to generate a new local Sanity repo since the repo I forked already has a Sanity app. Is there a way to create a new Project in Sanity without having to build a new Sanity app? I just need a new Project instance to connect to.
Jun 5, 2023, 6:54 PM
If you delete the
sanity.config
and
sanity.cli
files, then run
sanity init
will it initialize a new project using the existing schemas? It used to work this way in V2 and I think we may have recently added it back in.
Jun 5, 2023, 7:17 PM
I think
sanity init --reconfigure
was recently added.
Jun 5, 2023, 7:30 PM
Thank you
user M
and
user A
!! I think I've got it connected to the new Sanity project. I just inherited this project so I appreciate the help. šŸ™šŸ™ŒšŸ’Æ
Jun 5, 2023, 7:35 PM

Sanityā€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?