Skip to content
Tulos

Sanity setup

Create the Sanity project, tokens and CORS origins Tulos needs.

Sanity stores your catalog, orders, addresses, newsletter subscribers and contact messages, and powers the Studio at /studio.

1. Create the project

  1. Go to sanity.io/manage and create a project with a dataset named production.
  2. Copy the Project ID into NEXT_PUBLIC_SANITY_PROJECT_ID.
  3. Keep NEXT_PUBLIC_SANITY_DATASET=production.

2. Create two tokens

In API → Tokens:

Token Permission Variable Used for
Editor Editor SANITY_API_TOKEN Creating orders, addresses, ratings and messages
Viewer Viewer SANITY_API_READ_TOKEN Live content updates and draft previews

Warning

Both tokens are server-only. Never put them in a NEXT_PUBLIC_ variable.

3. Add CORS origins

In API → CORS origins, add http://localhost:3000 and your live domain, with Allow credentials ticked. The Studio and live updates need it.

4. Load the sample data

pnpm exec sanity login
pnpm seed

See Seed data for details.