Joint session with Vercel: How to build intelligent storefronts (May 15th)

Multi-client setup for multi-tenancy with separate studios in Sanity

3 repliesLast updated: Dec 1, 2025

Hey Everyone, I’m building a multi tenancy website and I would like to do it with multi clients (sanity/client). I saw the tutorial where we can do it with one client and multi database, however the clients will access they studio and they shouldn’t see each others studio. Is there any way I could do with multi clients?
AI Update

Great question! Let me clarify the different approaches for multi-tenancy in Sanity, since there's an important distinction between workspaces and separate projects.

Understanding Your Options

When you mention "multi clients," there are actually two architectural approaches:

1. Single Project with Multiple Datasets + Workspaces

This is what the tutorial you saw likely covered. You configure workspaces in your sanity.config.ts like this:

import {defineConfig} from 'sanity'

export default defineConfig([
  {
    projectId: 'abc123',
    dataset: 'client-a',
    name: 'client-a-workspace',
    basePath: '/client-a',
    title: 'Client A',
    // ... schema and plugins
  },
  {
    projectId: 'abc123',
    dataset: 'client-b', 
    name: 'client-b-workspace',
    basePath: '/client-b',
    title: 'Client B',
    // ... schema and plugins
  },
])

The problem: By default, all users can see all workspaces in the workspace switcher dropdown. To truly isolate clients from seeing each other's workspaces, you need Custom Roles (Enterprise plan only) to restrict dataset access. Even then, users will still see the same Studio URL and potentially the workspace switcher.

2. Separate Sanity Projects (True Isolation)

For complete isolation where clients can't see each other's Studios at all, you need separate Sanity projects - not just separate datasets. This means:

This is the approach if you want true "multi clients" where each client has zero visibility into other clients' existence.

If you need complete Studio isolation (which it sounds like you do), I'd recommend:

// sanity.config.ts
import {defineConfig} from 'sanity'

export default defineConfig({
  projectId: process.env.SANITY_STUDIO_PROJECT_ID,
  dataset: process.env.SANITY_STUDIO_DATASET || 'production',
  // ... rest of config
})

The Workspace + Custom Roles Approach

If you're on an Enterprise plan, you can use workspaces with Custom Roles and Content Resources to restrict access at the dataset level. However, this still shares the same Studio deployment, so users might see workspace names or the workspace switcher even if they can't access the content. You'd need to:

Summary

For true multi-tenancy where clients shouldn't see each other's Studios at all, separate projects with separate Studio deployments is the clearest path. Workspaces are great for internal team separation (dev/staging/prod, different departments, etc.) but not ideal for completely isolated client experiences without Enterprise features and additional customization.

Show original thread
3 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