Connecting a new repo to a new Sanity project without building a new Sanity app
Good news! You can absolutely create a new Sanity project without running sanity init or generating new local files. Since you already have your schemas and Studio configuration from your forked repo, you just need to create a new project instance and point your existing code to it.
Create a New Project via manage.sanity.io
The simplest way is to create a new project directly through manage.sanity.io:
- Go to manage.sanity.io in your browser
- Look for a "New project" or "Create project" button
- Fill in your project details (name, organization, plan, etc.)
- Once created, you'll get a new project ID
You can also access this interface from the command line without initializing a new project:
npx sanity@latest manageThis opens the management interface where you can create projects through the web UI.
Connect Your Forked Repo to the New Project
After creating the project, update your forked repo's configuration files:
1. Update sanity.cli.js (or .ts)
import { defineCliConfig } from "sanity/cli";
export default defineCliConfig({
api: {
projectId: "<your-new-project-id>", // Change this
dataset: "production",
}
});2. Update your Studio config (sanity.config.js or .ts)
import { defineConfig } from 'sanity'
export default defineConfig({
projectId: '<your-new-project-id>', // Change this
dataset: 'production',
// ... rest of your existing config
})3. Update environment variables
If you're using environment variables in your Next.js app (like NEXT_PUBLIC_SANITY_PROJECT_ID), update those in your .env files:
NEXT_PUBLIC_SANITY_PROJECT_ID=your-new-project-id NEXT_PUBLIC_SANITY_DATASET=production
Create Your Dataset
Don't forget to create the dataset for your new project. You can do this:
- Through manage.sanity.io in your project settings
- Or using the CLI:
sanity dataset create production
Since you're working in an NX monorepo with existing schemas, this approach lets you reuse all your Studio configuration and schema definitions while pointing to a completely separate Sanity project instance. No need to scaffold any new files!
Sanity β Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.