CMS Guide
Sanity Studio is hosted on Sanity (App Studio). The storefront pulls content via GROQ and revalidates via webhook on publish.
- Studio URL: https://www.sanity.io/@oJjkNT4GN/studio/blgyxui5ep83evp3wncgrwyy
- Storefront URL: https://rubrion.store
- Sanity project:
rubrion-store(idl54kfv7o) - Dataset:
production
Accessing Studio
- Open the Studio URL above.
- Log in with your Sanity account.
- If access is denied, ask the project owner to invite you: sanity.io/manage →
rubrion-store→ Members → Invite member → roleEditororViewer.
The sidebar shows: Home pages, Navigation, Landing pages, Static pages — each per locale (BR / ES / US).
Daily editing flow
Home page
- Sidebar → Home pages → choose locale.
- Fill Hero (heading, paragraph, image, up to 3 buttons) + Sections (Banner / CTA / Featured products).
- Set SEO if needed. Click Publish.
Landing page
- Sidebar → Landing pages → + Create.
- Fill Internal title, Locale, Slug (e.g.
summer-sale). - Publish → live at
https://rubrion.store/us/summer-sale.
Navigation
- Sidebar → Navigation → choose locale.
- Edit Header links, Footer groups, Legal links. Publish.
Static pages
- Sidebar → Static pages → + Create.
- Fill title, locale, slug (e.g.
privacy), body (rich text). - Publish → live at
https://rubrion.store/us/pages/privacy.
Cache revalidation
Two paths run in parallel:
- Webhook (instant) — on Publish, Sanity fires a signed webhook →
/api/revalidate. Handler invalidates Next.js cache tags scoped to the doc (~1 second). - ISR fallback (60 s) — if the webhook ever fails, Next.js auto-revalidates after 60 s on the next request.
Verify webhook health: sanity.io/manage → rubrion-store → API → Webhooks → Attempts tab. Look for HTTP 200 responses.
Updating Studio schema
cd apps/storefront
# 1. Edit schema files under sanity/schemas/
# 2. Edit sanity/structure.ts if sidebar layout changed
# 3. Validate locally
bunx sanity schema validate
# 4. Deploy schema + Studio
bun run studio:deploy
For iterating locally without deploying:
bun run studio:dev # local Studio at http://localhost:3333
CMS env vars (Marketplace service on Railway)
| Var | Purpose |
|---|---|
NEXT_PUBLIC_SANITY_PROJECT_ID | Sanity project to read from |
NEXT_PUBLIC_SANITY_DATASET | dataset name (production) |
NEXT_PUBLIC_SANITY_API_VERSION | API version pin |
SANITY_API_READ_TOKEN | Server-only read token |
SANITY_REVALIDATE_SECRET | Webhook signature secret |
Common operations
| Task | Where | Redeploy needed |
|---|---|---|
| Change hero copy | Studio → Home pages → publish | No |
| Add new banner section | Studio → Home → Sections → publish | No |
| Add a new locale | Edit sanity/env.ts + storefront i18n | Yes + studio:deploy |
| Add new field to existing schema | Edit sanity/schemas/...ts → studio:deploy | Only if storefront consumes new field |
| Update GROQ query | Edit sanity/lib/queries.ts | Yes (storefront) |
| Change webhook secret | Sanity webhooks UI and Railway env | Yes (storefront) |