# Extracting your schema https://www.sanity.io/learn/course/typescripted-content/extracting-your-schema.md Learn how to extract your Sanity Studio schema into a JSON file. This is a crucial step before generating TypeScript types. This file, a static representation of your data's shape, will be used for type generation. Before generating TypeScript types, you need to extract the Sanity Studio schema written in JavaScript into a _static representation_, a JSON file describing the shape of the data your Sanity Studio produces. 1. **Run** the following Sanity CLI command in your studio project folder: ```sh:Terminal npx sanity@latest schema extract ``` If your command ran successfully, you should see a new file called `schema.json` in your Studio project folder. In this course, you will only use this file for the type generation; you don’t need to do anything else with it. If you explore its content, you will find your Studio schema described in a JSON format. For example, the document type for `venue` will look something like this: ```json:schema.json { "name": "venue", "type": "document", "attributes": { "_id": { "type": "objectAttribute", "value": { "type": "string" } }, "_type": { "type": "objectAttribute", "value": { "type": "string", "value": "venue" } }, "_createdAt": { "type": "objectAttribute", "value": { "type": "string" } }, "_updatedAt": { "type": "objectAttribute", "value": { "type": "string" } }, "_rev": { "type": "objectAttribute", "value": { "type": "string" } }, "name": { "type": "objectAttribute", "value": { "type": "string" }, "optional": true }, "city": { "type": "objectAttribute", "value": { "type": "string" }, "optional": true }, "country": { "type": "objectAttribute", "value": { "type": "string" }, "optional": true } } } ``` This file can be used to develop tooling that needs to know about a Sanity Studio schema. But in this course, you will use it to generate TypeScript types.