Sanity
Mkdirs uses Sanity as a headless CMS, so you can manage the content of the website (including user data, items data, blog posts data, images, etc.) through Sanity Studio, and you don’t need to configure the database or the storage anymore.
Configuration
-
Create an account on Sanity
If don’t have an account on Sanity, follow their steps to signup.
-
Create a new project
After signin on Sanity, you can create your project here.
-
Get the project id
After creating the project, you will see the project id under the project name.
-
Get the dataset
The default dataset is
production
, and you can use the default dataset or create a new one. -
Get the API token
Go to the project API settings, click on the
Add API token
button, create a new token with the permissions ofEditor
, and set it to the.env
file. -
Configure the CORS origins
Go to the project API settings, click on the
Add CORS origin
button, add the origin of your domain (e.g.https://your-domain.com
) orhttp://localhost:3000
for local development.It’s used to allow you to access the Sanity Studio under the
/studio
path, for example,https://your-domain.com/studio
orhttp://localhost:3000/studio
.