Note
This starter features an
/app
and a/studio
folder. The/app
folder contains the frontend code, and the/studio
folder contains the Sanity Studio code.This is not a monorepo setup. put them both in one repository for the sake of simplicity.
The following commands are meant to be run in both the /app
and /studio
folders.
npm install
to install dependenciesnpx -y sanity@latest init --env
, this will:
- ask you to select or create a Sanity project and dataset, use the same Sanity project and dataset in both folders.
- output a
.env
file with appropriate variables - (or use
sanity init --env
if you have the CLI installed)
- Prefix your environment variables in the SvelteKit
/app
folder withPUBLIC_
, they should bePUBLIC_SANITY_DATASET
andPUBLIC_SANITY_PROJECT_ID
. npm run dev
to start the development server