Sanity Template manifest
The manifest.json file is how to configure a new 1-click Sanity Starter.
The manifest.json file is the key component of creating a 1-click starter for use on sanity.io/create. The file lives in the .sanity-template directory at the root of a new starter and has all the configuration information to create a new starter.
- Full conceptual documentation
- Create your first Netlify starter guide
- Create your first Vercel starter guide
Example sanity-template.json
{
"version": 2,
"title": "A Descriptive Title for your Starter",
"description": "A short description for your starter (maybe a couple sentences)",
"previewMedia": {
"type": "image",
"src": "assets/path-to-preview-image.png",
"alt": "Alt text here"
},
"deployment": {
"provider": "netlify",
"sites": [
{
"id": "studio",
"type": "studio",
"title": "Sanity Studio",
"description": "The Sanity Studio is where you edit and structure your content.",
"dir": "./studio-path",
"previewMedia": {
"type": "image",
"src": "assets/path-to-image.png",
"alt": "Alt text here"
},
"buildSettings": {
"base": "studio-path",
"dir": "dist",
"cmd": "npm run build"
}
},
{
"id": "site",
"type": "web",
"title": "Title for the project",
"description": "Description for the project",
"dir": "./site-directory",
"buildSettings": {
"base": "site-directory",
"dir": "./directory-to-deploy",
"cmd": "npm run build"
},
"previewMedia": {
"type": "image",
"src": "assets/path-to-image.png",
"alt": "Alt text here"
}
}
]
}
}General data about the starter
General information about the starter lives in the root level of the JSON object: title, description, API version, and preview image.
Example
{
"version": 2,
"title": "A Descriptive Title for your Starter",
"description": "A short description for your starter (maybe a couple sentences)",
"previewMedia": {
// ...
},
"deployment": {
// ...
}
// ...
}Properties
Requiredversionnumber
The
versionproperty contains information about what version of the sanity-template API to use. All new Starters should use2.Requiredtitlestring
A string that will show on sanity.io/create, GitHub, and Netlify as the title of the project and/or Studio
descriptionstring
A description of what the Starter contains. Best practice would be to have this describe the project in 2-3 sentences. This should contain the primary use case for the Starter, as well as any special information a developer would need to know.
previewMediaobject
An object containing information about the preview image for the entire starter. This appears on the main sanity.io/create page that is generated from the GitHub repository and is the main image before a developer creates the project.
Requireddeploymentobject
An object containing the information required to deploy the site(s) on a given provider.
previewMedia
Preview images are used in 2 locations on the Create page: overview preview and site-specific previews. The assets are stored in the root of the Starter repository in a folder usually named assets.
Example
"previewMedia": {
"type": "image",
"src": "assets/path-to-preview-image.png",
"alt": "Alt text here"
}Properties
Requiredtypestring
A string containing the type of media. At this time, only
imageis supported.Requiredsrcstring
A string corresponding to where the media lives in the project. By convention, this should be in a root directory called
assets.Requiredaltstring
A string of
alttext for the resulting image. This should be descriptive of what is contained in the image for accessibility.
deployment
The deployment object contains all the information necessary for a hosting provider to build and deploy the site(s) contained inside a Starter. Depending on the deployment provider, different properties are necessary.
Example
"deployment": {
"provider": "netlify",
"sites": [ ... ]
}Properties
Requiredproviderstring
A string corresponding to a supported provider. Currently accepted string values:
netlifysites (Netlify only)array
An array of objects containing the deployment information about specific sites the deployment host will build.
corsOrigins (Vercel only)array
An array of objects containing the
originURL and anallowCredentialsboolean. These values will be added to the Sanity project's data. Live URLs will be provided by the application, this should be set to default development URLs for a front-end framework.tokens (Vercel only)Array
An array of token objects containing a
label,role, andenvVar. These tokens will be added to your Sanity project and the environment variable will be added to your deployment provider.envVars (Vercel only)Object
An object containing the
projectIdanddatasetkeys. These properties contain an array of strings to name the Sanity Project ID and Dataset information for the deployment platform.
sites object (for Netlify deploys)
Inside the deployment object is an array of sites to be deployed to Netlify. This can be a single object or multiple sites to deploy. These objects contain the information specific to deploying that site. These sites behave as a monorepo inside of Netlify's architecture.
Example
{
"id": "site",
"type": "web",
"title": "Title for the project",
"description": "Description for the project",
"dir": "./site-directory",
"buildSettings": {
"base": "site-directory",
"dir": "./directory-to-deploy",
"cmd": "npm run build"
},
"previewMedia": {
"type": "image",
"src": "assets/path-to-image.png",
"alt": "Alt text here"
}
}Properties
Requiredidstring
Unique identifier per site to deploy in the current project.
Requiredtypestring
A string corresponding to one of two values:
weborstudio. Thestudiovalue will set up a Studio instance. Thewebvalue is for any other project type.Requiredtitlestring
A string corresponding to the site's title. This is displayed both on sanity.io/create as well as in the deployment provider.
Requireddescriptionstring
A string corresponding to the site's description. This is displayed on sanity.io/create.
Requireddirstring
A string corresponding to the path to the site's files.
buildSettingsobject
An object with information for the deployment host to run.
previewMediaobject
An object containing information about the preview image for the specific site launched by the starter. This appears on the main sanity.io/create page that is generated from the GitHub repository after a developer has clicked "Create Project"
requiredCorsOriginsArray
An array of objects containing the
originandallowCredentialsproperties to set in a Sanity project.requiredTokensArray
An array of objects that contain the
roleproperty andlabelproperty.roleshould contain a string matching a Token role:read,write, anddeploy-studio.labelshould be a human-readable title for the Token.requirementsArray
An array containing the
build-hookstring. This will inform Netlify and Sanity to set up a webhook for communication between the platforms.
buildSettings (for Netlify Deploys)
The buildSettings object contains information for a deployment provider to use when building a given site.