Sanity Studio TypeScript starter project or reference?

6 replies
Last updated: Jan 28, 2026
Hey all! Is there a good sanity starter studio available with Typescript? I want to transition my studio to using typescript and need a reference project (hopefully one by the sanity team) to create my types correctly. Let me know if any projects come to mind!:)
AI Update

Good news! The Sanity team provides several official TypeScript starter templates, and the best part is that TypeScript is now the default for all new Sanity projects.

When you run sanity init (the official CLI command for creating new projects), it will automatically set up a TypeScript-based Studio unless you explicitly opt out with the --no-typescript flag. The CLI will walk you through an interactive setup where you can choose templates like "clean" (minimal starter) or "blog" (pre-configured content types).

Official Starter Templates

The Sanity team maintains several official TypeScript templates on GitHub:

All of these include TypeScript configuration out of the box and serve as excellent reference projects.

TypeScript Type Generation

For transitioning your existing studio, you'll want to use the sanity typegen CLI command. This generates TypeScript types from your schemas automatically:

# Extract your schema
npx sanity@latest schema extract

# Generate types
npx sanity@latest typegen generate

This creates a sanity.types.ts file with types for all your schema types, which you can then import throughout your project. The generated types work great with the Sanity client for type-safe queries and mutations.

Sanity also offers a free course called "Typed content with Sanity TypeGen" that covers schema extraction, type generation, and working with GROQ query types using the defineQuery helper.

For a quick start with a clean TypeScript Studio, just run npx sanity@latest init and follow the prompts!

Show original thread
6 replies

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.

Was this answer helpful?