How to host Sanity and Next.js together on Vercel: monorepo or single project?

2 repliesLast updated: Nov 29, 2025

I am new to the field. May I ask how should I host sanity and the nextjs web through vercel? Should I do it in monorepo or should I host it in one project? I have tried to host it in one project, however I am completely puzzled on how to do that as it seems there isn't a guide for it and when I read through many github projects that host both the web and sanity in the same project, the configuration method seems to differ from project to project. Thanks for any help!
AI Update

Great question! This is a common point of confusion for newcomers. Let me break down your options and give you clear guidance.

The Two Main Approaches

You have two viable options for hosting Sanity Studio and your Next.js site on Vercel:

This approach embeds Sanity Studio directly into your Next.js application as a route. It's simpler to manage and is the modern, recommended approach.

How it works:

Setting it up:

With the next-sanity toolkit, you can embed Studio in your Next.js App Router. The official documentation on embedding Sanity Studio provides detailed guidance.

import { NextStudio } from 'next-sanity/studio'
import config from '../../../sanity.config'

export default function StudioPage() {
  return <NextStudio config={config} />
}

Why this approach is simpler:

2. Monorepo (Separate Projects)

This keeps Studio and your Next.js site as completely separate applications that share code in a monorepo structure.

When to use this:

Setting it up:

Your folder structure would look like:

my-project/
├── apps/
│   ├── web/          (Next.js site)
│   └── studio/       (Sanity Studio)
└── packages/         (shared code)

On Vercel, you'd create two separate projects and set the "Root Directory" in each project's settings to point to apps/web and apps/studio respectively.

Why Projects Look Different

You're absolutely right that projects vary! This is because:

My Recommendation

Start with the embedded approach (option 1). It's simpler, requires less configuration, and is what Sanity's current documentation and tooling support best. The next-sanity package makes this straightforward, and you avoid all the monorepo complexity.

Only go with a monorepo if you have specific requirements like:

The embedded approach is not only easier to set up but also easier to understand as you're learning, and you can always refactor to a monorepo later if your needs change.

Show original thread
2 replies

Was this answer helpful?

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.

Related contributions