
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGood 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).
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.
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 generateThis 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!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store