Skip to content

Schema Reference

Schema types live in packages/sanity/src/schema/: documents (content types) and objects (reusable embedded types). The main export is schemaTypes in schema/index.ts.

packages/sanity/src/schema/
├── index.ts # schemaTypes = [...schemaDocuments, ...schemaObjects]
├── documents/
│ ├── index.ts # Exports schemaDocuments
│ ├── settings.ts
│ ├── artist.ts
│ ├── contact.ts
│ ├── event.ts
│ ├── newsletter.ts
│ ├── page.ts
│ ├── playlist.ts
│ ├── song.ts
│ └── venue.ts
└── objects/
└── index.ts # schemaObjects (currently empty)

Site-wide venue and SEO. Uses groups from utils/groups.ts: General Information, Operations, SEO & Social.

GroupFields (summary)
GeneralvenueName, logo, address (street, city, state, zip, country), contact (phone, email, bookingEmail)
Operationshours (mon–sun strings), booking (reservationsEnabled, reservationUrl, bookingInstructions), ageRestriction (list), coverCharge
SEO & Socialtitle, url (from constants), description, keywords (tags), socialMedia (facebook, instagram, twitter, youtube, spotify, soundcloud)

name, description, photo, contactInfo (reference → contact).

name, phone, email, notes. Referenced by Artist and others.

name, city. Referenced by Event (for in-person events).

name, slug (required), eventType (in-person | virtual), date (datetime), doorsOpen (number), venue (reference → venue, for in-person), headline (reference → artist), image, details (block array), tickets (url). Preview shows name, artist, date, venue.

Groups: Content, SEO, Settings. title, slug, content (blocks), metaDescription, keywords (tags), ogImage, ogTitle, ogDescription, canonicalUrl, createdAt, createdBy (userSelect), lastModifiedAt, lastModifiedBy (userSelect).

title, artist, album, releaseDate (year), slug, plus other fields. See packages/sanity/src/schema/documents/song.ts for full list.

name, songs (array of references → song).

title.

No custom object types are defined; schemaObjects is an empty array. Inline object fields are used (e.g. Settings address, contact, socialMedia).

  • utils/groups.ts defines GROUP constants and group arrays:
    • GROUPS — used by Page (Content, SEO, Settings)
    • SETTINGS_GROUPS — used by Settings (General Information, Operations, SEO & Social)
  1. Add packages/sanity/src/schema/documents/myDocument.ts with defineType({ name: 'myDocument', type: 'document', fields: [...] }).
  2. Export from schema/documents/index.ts: import { myDocument } from './myDocument' and add to schemaDocuments.
  1. Add a file under schema/objects/ and export from schema/objects/index.ts in schemaObjects.

Common types: string, text, number, boolean, datetime, url, email, slug, image, array, object, reference, block. This project also uses tags (sanity-plugin-tags-v4) and userSelect (sanity-plugin-user-select-input). See Sanity schema types.