Provisioning Sanity
Using the import configuration property to provision Sanity when duplicating a GitHub repository.
This is only relevant when creating a Stackbit project by duplicating a GitHub repository.
You don't need Sanity provisioning if you have already set up a Sanity project for your project, or if you plan to manually create and configure a project.
Stackbit will handle provisioning a new Sanity project, along with the initial payload of models and content when creating a new project by duplicating a GitHub repository.
Exporting Content from Sanity
In most cases, projects that can be provisioned with Sanity as a content source have a Sanity project as the source of truth for duplicated projects.
The first step in preparing your project to be duplicated is to export the content schema and the initial site contents from your Sanity project.
Be sure to configure the export to include a compressed file of all appropriate schemas, documents, and assets. Commit the exported data file to your project. See here for an example.
export.tar.gz
file, like the one found in our Sanity starter.
Import Configuration
Once you've exported the content (and committed the data file), all that is left to do is add configuration for importing the content during the provisioning process.
The following properties should be added to an import
property in your Stackbit configuration file. All properties are required and are strings, unless otherwise noted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26