TypeScript definitions and generator for Schema.org vocabulary with strongly-typed JSON-LD support
—
Schema.org types for events, performances, courses, conferences, and scheduled activities of all kinds.
The root type for all events and scheduled activities.
/**
* An event happening at a certain time and location, such as a concert, lecture, or festival
*/
type Event = EventLeaf | BusinessEvent | ChildrensEvent | ComedyEvent |
CourseInstance | DanceEvent | DeliveryEvent | EducationEvent | EventSeries |
ExhibitionEvent | Festival | FoodEvent | Hackathon | LiteraryEvent |
MusicEvent | PublicationEvent | SaleEvent | ScreeningEvent | SocialEvent |
SportsEvent | TheaterEvent | UserInteraction | VisualArtsEvent;
interface EventBase extends ThingBase {
/** A person or organization attending the event */
attendee?: SchemaValue<Organization | Person, "attendee">;
/** An intended audience, i.e. a group for whom something was created */
audience?: SchemaValue<Audience, "audience">;
/** The subject matter of the content */
about?: SchemaValue<Thing, "about">;
/** A person born in this place */
composer?: SchemaValue<Organization | Person, "composer">;
/** A secondary contributor to the CreativeWork or Event */
contributor?: SchemaValue<Organization | Person, "contributor">;
/** A director of e.g. TV, radio, movie, video gaming etc. content, or of an event */
director?: SchemaValue<Person, "director">;
/** The time admission will commence */
doorTime?: SchemaValue<DateTime | Time, "doorTime">;
/** The duration of the item */
duration?: SchemaValue<Duration, "duration">;
/** The end date and time of the item */
endDate?: SchemaValue<Date | DateTime, "endDate">;
/** An eventAttendanceMode of an event indicates whether it occurs online, offline, or a mix */
eventAttendanceMode?: SchemaValue<EventAttendanceModeEnumeration, "eventAttendanceMode">;
/** Associates an Event with a Schedule */
eventSchedule?: SchemaValue<Schedule, "eventSchedule">;
/** An eventStatus of an event represents its status; particularly useful when an event is cancelled or rescheduled */
eventStatus?: SchemaValue<EventStatusType, "eventStatus">;
/** A person or organization that supports (sponsors) something through some kind of financial contribution */
funder?: SchemaValue<Organization | Person, "funder">;
/** The language of the content or performance or used in an action */
inLanguage?: SchemaValue<Language | Text, "inLanguage">;
/** A flag to signal that the item, event, or place is accessible for free */
isAccessibleForFree?: SchemaValue<Boolean, "isAccessibleForFree">;
/** Keywords or tags used to describe some item */
keywords?: SchemaValue<DefinedTerm | Text | URL, "keywords">;
/** The location of, for example, where an event is happening, where an organization is located */
location?: SchemaValue<Place | PostalAddress | Text | VirtualLocation, "location">;
/** The total number of individuals that may attend an event or venue */
maximumAttendeeCapacity?: SchemaValue<Integer, "maximumAttendeeCapacity">;
/** The maximum physical attendee capacity of an Event whose eventAttendanceMode is OfflineEventAttendanceMode */
maximumPhysicalAttendeeCapacity?: SchemaValue<Integer, "maximumPhysicalAttendeeCapacity">;
/** The maximum virtual attendee capacity of an Event whose eventAttendanceMode is OnlineEventAttendanceMode */
maximumVirtualAttendeeCapacity?: SchemaValue<Integer, "maximumVirtualAttendeeCapacity">;
/** An offer to provide this item */
offers?: SchemaValue<Demand | Offer, "offers">;
/** An organizer of an Event */
organizer?: SchemaValue<Organization | Person, "organizer">;
/** A performer at the event */
performer?: SchemaValue<Organization | Person, "performer">;
/** Used in conjunction with eventStatus for rescheduled or cancelled events */
previousStartDate?: SchemaValue<Date, "previousStartDate">;
/** The CreativeWork that captured all or part of this Event */
recordedIn?: SchemaValue<CreativeWork, "recordedIn">;
/** The number of attendee places for an event that remain unallocated */
remainingAttendeeCapacity?: SchemaValue<Integer, "remainingAttendeeCapacity">;
/** A review of the item */
review?: SchemaValue<Review, "review">;
/** A person or organization that supports a thing through a pledge, promise, or financial contribution */
sponsor?: SchemaValue<Organization | Person, "sponsor">;
/** The start date and time of the item */
startDate?: SchemaValue<Date | DateTime, "startDate">;
/** An Event that is part of this event */
subEvent?: SchemaValue<Event, "subEvent">;
/** An event that this event is a part of */
superEvent?: SchemaValue<Event, "superEvent">;
/** Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market */
translator?: SchemaValue<Organization | Person, "translator">;
/** The typical expected age range */
typicalAgeRange?: SchemaValue<Text, "typicalAgeRange">;
/** The work that this work has been translated from */
workFeatured?: SchemaValue<CreativeWork, "workFeatured">;
/** The work performed in this event */
workPerformed?: SchemaValue<CreativeWork, "workPerformed">;
}Enumerations for event states and attendance modes.
/**
* EventStatusType is an enumeration of several kinds of Event status
*/
type EventStatusType = "https://schema.org/EventCancelled" | "EventCancelled" |
"https://schema.org/EventMovedOnline" | "EventMovedOnline" |
"https://schema.org/EventPostponed" | "EventPostponed" |
"https://schema.org/EventRescheduled" | "EventRescheduled" |
"https://schema.org/EventScheduled" | "EventScheduled" | EventStatusTypeLeaf;
/**
* An EventAttendanceModeEnumeration value is one of potentially several modes of organising an event
*/
type EventAttendanceModeEnumeration = "https://schema.org/MixedEventAttendanceMode" |
"MixedEventAttendanceMode" | "https://schema.org/OfflineEventAttendanceMode" |
"OfflineEventAttendanceMode" | "https://schema.org/OnlineEventAttendanceMode" |
"OnlineEventAttendanceMode" | EventAttendanceModeEnumerationLeaf;Usage Examples:
import type { Event, EventStatusType, EventAttendanceModeEnumeration } from "schema-dts";
// Basic conference event
const conference: Event = {
"@type": "Event",
name: "Tech Conference 2024",
description: "Annual technology conference featuring latest innovations",
startDate: "2024-06-15T09:00:00",
endDate: "2024-06-16T17:00:00",
location: {
"@type": "Place",
name: "Convention Center",
address: {
"@type": "PostalAddress",
streetAddress: "123 Convention Ave",
addressLocality: "San Francisco",
addressRegion: "CA",
postalCode: "94102",
addressCountry: "US"
}
},
organizer: {
"@type": "Organization",
name: "Tech Events Inc."
},
eventStatus: "EventScheduled",
eventAttendanceMode: "OfflineEventAttendanceMode",
maximumAttendeeCapacity: 500,
isAccessibleForFree: false
};
// Online webinar event
const webinar: Event = {
"@type": "Event",
name: "Introduction to AI",
description: "Learn the basics of artificial intelligence",
startDate: "2024-03-20T14:00:00",
endDate: "2024-03-20T15:30:00",
duration: "PT1H30M",
location: {
"@type": "VirtualLocation",
url: "https://zoom.us/j/123456789"
},
eventAttendanceMode: "OnlineEventAttendanceMode",
maximumVirtualAttendeeCapacity: 1000,
isAccessibleForFree: true,
inLanguage: "en"
};
// Hybrid event
const hybridEvent: Event = {
"@type": "Event",
name: "Annual Company Meeting",
startDate: "2024-04-10T10:00:00",
endDate: "2024-04-10T16:00:00",
eventAttendanceMode: "MixedEventAttendanceMode",
location: [
{
"@type": "Place",
name: "Company Headquarters"
},
{
"@type": "VirtualLocation",
url: "https://meet.company.com/annual-meeting"
}
],
maximumPhysicalAttendeeCapacity: 200,
maximumVirtualAttendeeCapacity: 800
};Events related to business, education, and professional development.
/**
* An event happening at a certain time and location, such as a concert, lecture, or festival
*/
type BusinessEvent = BusinessEventLeaf;
/**
* Event type: Education event
*/
type EducationEvent = EducationEventLeaf;
/**
* A course instance or offering of a course
*/
type CourseInstance = CourseInstanceLeaf;
interface CourseInstanceBase extends EventBase {
/** The medium or means of delivery of the course instance or the mode of study */
courseMode?: SchemaValue<Text | URL, "courseMode">;
/** The course that this course instance is associated with */
courseWorkload?: SchemaValue<Text, "courseWorkload">;
/** A person assigned to instruct or provide instructional assistance for the CourseInstance */
instructor?: SchemaValue<Person, "instructor">;
}Usage Examples:
import type { BusinessEvent, EducationEvent, CourseInstance } from "schema-dts";
// Business networking event
const networkingEvent: BusinessEvent = {
"@type": "BusinessEvent",
name: "Startup Networking Mixer",
description: "Connect with fellow entrepreneurs and investors",
startDate: "2024-05-15T18:00:00",
endDate: "2024-05-15T21:00:00",
location: {
"@type": "Place",
name: "Innovation Hub",
address: {
"@type": "PostalAddress",
streetAddress: "456 Startup St",
addressLocality: "Silicon Valley",
addressRegion: "CA",
addressCountry: "US"
}
},
organizer: {
"@type": "Organization",
name: "Entrepreneurs Association"
},
audience: {
"@type": "BusinessAudience",
name: "Entrepreneurs and Investors"
}
};
// Educational workshop
const workshop: EducationEvent = {
"@type": "EducationEvent",
name: "Python Programming Workshop",
description: "Hands-on workshop for beginners",
startDate: "2024-04-20T10:00:00",
endDate: "2024-04-20T16:00:00",
duration: "PT6H",
instructor: {
"@type": "Person",
name: "Dr. Python Teacher",
jobTitle: "Senior Software Engineer"
},
audience: {
"@type": "EducationalAudience",
educationalRole: "student"
},
typicalAgeRange: "18-65"
};
// University course instance
const courseSession: CourseInstance = {
"@type": "CourseInstance",
name: "Introduction to Computer Science - Fall 2024",
courseMode: "in-person",
startDate: "2024-09-01",
endDate: "2024-12-15",
instructor: [
{
"@type": "Person",
name: "Prof. Computer Science"
}
],
location: {
"@type": "Place",
name: "University Campus",
address: {
"@type": "PostalAddress",
addressLocality: "College Town",
addressRegion: "State",
addressCountry: "US"
}
},
courseWorkload: "15 hours per week"
};Events for entertainment, arts, sports, and cultural activities.
/**
* Event type: Music event
*/
type MusicEvent = MusicEventLeaf;
/**
* Event type: Sports event
*/
type SportsEvent = SportsEventLeaf;
/**
* Event type: Theater event
*/
type TheaterEvent = TheaterEventLeaf;
/**
* A social event
*/
type SocialEvent = SocialEventLeaf;
/**
* Event type: Comedy event
*/
type ComedyEvent = ComedyEventLeaf;
/**
* Event type: Dance event
*/
type DanceEvent = DanceEventLeaf;
/**
* Event type: Visual arts event
*/
type VisualArtsEvent = VisualArtsEventLeaf;
/**
* A festival or similar arts or cultural event
*/
type Festival = FestivalLeaf;
/**
* ExhibitionEvent is a subtype of Event representing an event where art works, installations, or other cultural or educational items are presented to the public
*/
type ExhibitionEvent = ExhibitionEventLeaf;Usage Examples:
import type { MusicEvent, SportsEvent, TheaterEvent, Festival } from "schema-dts";
// Concert event
const concert: MusicEvent = {
"@type": "MusicEvent",
name: "Jazz Night at Blue Note",
description: "Evening of contemporary jazz music",
startDate: "2024-07-20T20:00:00",
endDate: "2024-07-20T23:00:00",
performer: [
{
"@type": "Person",
name: "Miles Davis Tribute Band"
}
],
location: {
"@type": "MusicVenue",
name: "Blue Note Jazz Club",
address: {
"@type": "PostalAddress",
streetAddress: "131 W 3rd St",
addressLocality: "New York",
addressRegion: "NY",
addressCountry: "US"
}
},
offers: {
"@type": "Offer",
price: "25.00",
priceCurrency: "USD",
availability: "InStock"
}
};
// Sports event
const basketballGame: SportsEvent = {
"@type": "SportsEvent",
name: "Lakers vs Warriors",
description: "NBA Regular Season Game",
startDate: "2024-12-25T15:00:00",
location: {
"@type": "StadiumOrArena",
name: "Staples Center",
address: {
"@type": "PostalAddress",
addressLocality: "Los Angeles",
addressRegion: "CA",
addressCountry: "US"
}
},
competitor: [
{
"@type": "SportsTeam",
name: "Los Angeles Lakers"
},
{
"@type": "SportsTeam",
name: "Golden State Warriors"
}
],
sport: "Basketball"
};
// Theater performance
const play: TheaterEvent = {
"@type": "TheaterEvent",
name: "Hamlet",
description: "Shakespeare's classic tragedy",
startDate: "2024-08-15T19:30:00",
endDate: "2024-08-15T22:00:00",
location: {
"@type": "PerformingArtsTheater",
name: "Broadway Theater"
},
performer: [
{
"@type": "Person",
name: "Lead Actor"
}
],
workPerformed: {
"@type": "Play",
name: "Hamlet",
author: {
"@type": "Person",
name: "William Shakespeare"
}
}
};
// Arts festival
const artsFestival: Festival = {
"@type": "Festival",
name: "Summer Arts Festival",
description: "Annual celebration of local arts and culture",
startDate: "2024-06-01",
endDate: "2024-06-30",
location: {
"@type": "Park",
name: "Central Park"
},
subEvent: [
{
"@type": "MusicEvent",
name: "Opening Concert"
},
{
"@type": "ExhibitionEvent",
name: "Local Artists Exhibition"
}
]
};Additional event types for specific contexts and activities.
/**
* Event type: Children's event
*/
type ChildrensEvent = ChildrensEventLeaf;
/**
* A DeliveryEvent in which the package containing the goods is delivered to the recipient directly by a local business
*/
type DeliveryEvent = DeliveryEventLeaf;
/**
* A food-related event
*/
type FoodEvent = FoodEventLeaf;
/**
* A hackathon event
*/
type Hackathon = HackathonLeaf;
/**
* A literary event such as a reading, performance, or publication event
*/
type LiteraryEvent = LiteraryEventLeaf;
/**
* Event type: A movie showing
*/
type ScreeningEvent = ScreeningEventLeaf;
/**
* A sale event such as a sample sale or trunk show
*/
type SaleEvent = SaleEventLeaf;Usage Examples:
import type { ChildrensEvent, FoodEvent, Hackathon, SaleEvent } from "schema-dts";
// Children's birthday party
const kidsParty: ChildrensEvent = {
"@type": "ChildrensEvent",
name: "Emma's 8th Birthday Party",
description: "Birthday celebration with games and cake",
startDate: "2024-05-10T14:00:00",
endDate: "2024-05-10T17:00:00",
location: {
"@type": "Place",
name: "Community Center"
},
typicalAgeRange: "5-12",
attendee: [
{
"@type": "Person",
name: "Emma",
birthDate: "2016-05-10"
}
]
};
// Food festival
const foodFest: FoodEvent = {
"@type": "FoodEvent",
name: "International Food Festival",
description: "Taste cuisines from around the world",
startDate: "2024-09-15T11:00:00",
endDate: "2024-09-15T19:00:00",
location: {
"@type": "Park",
name: "City Park"
},
offers: {
"@type": "Offer",
price: "10.00",
priceCurrency: "USD",
description": "Entry fee"
}
};
// Hackathon
const codingEvent: Hackathon = {
"@type": "Hackathon",
name: "Climate Change Hackathon",
description: "48-hour coding event to solve climate challenges",
startDate: "2024-04-05T18:00:00",
endDate: "2024-04-07T18:00:00",
duration: "PT48H",
location: {
"@type": "Place",
name: "Tech Hub"
},
organizer: {
"@type": "Organization",
name: "Green Tech Initiative"
},
about: "Climate Change Solutions",
maximumAttendeeCapacity: 100
};
// Sale event
const sampleSale: SaleEvent = {
"@type": "SaleEvent",
name: "Designer Sample Sale",
description: "Up to 70% off designer clothing",
startDate: "2024-11-25T09:00:00",
endDate: "2024-11-27T20:00:00",
location: {
"@type": "Store",
name: "Fashion Outlet"
},
offers: {
"@type": "Offer",
description: "Designer clothing at discounted prices",
priceCurrency: "USD"
}
};Install with Tessl CLI
npx tessl i tessl/npm-schema-dts