Quickstart
This guide walks through the complete path from installation to a live API call — sessions at a cinema site, returned as typed objects.
Before you start
You need a Vista Group operator token. If you don’t have one yet, see Authentication.
-
Install the SDK
Terminal window npm install @theatrical/sdk -
Create the client
import { TheatricalClient } from '@theatrical/sdk';const client = TheatricalClient.create({apiKey: process.env.THEATRICAL_API_KEY,baseUrl: 'https://your-vista-instance.example.com',});Or use the singleton pattern for application-wide access:
// In your app entry pointTheatricalClient.setGlobal({apiKey: process.env.THEATRICAL_API_KEY,baseUrl: 'https://your-vista-instance.example.com',});// Anywhere in your appconst client = TheatricalClient.global(); -
Fetch sessions
const { sessions } = await client.sessions.list({siteId: 'site-001',date: '2026-04-20',});for (const session of sessions) {console.log(`${session.filmTitle} — ${session.startTime} — ${session.screenName}`);}The response is fully typed. Your editor will autocomplete
session.filmTitle,session.screenName,session.format, and all nested fields. -
Check seat availability
const availability = await client.sessions.availability(sessions[0].id);const availableSeats = availability.seats.filter(s => s.status === 'available');console.log(`${availableSeats.length} seats available`); -
Create an order
const order = await client.orders.create({sessionId: sessions[0].id,tickets: [{ type: 'adult', seatId: availableSeats[0].id },{ type: 'adult', seatId: availableSeats[1].id },],});const confirmed = await client.orders.confirm(order.id);console.log(`Order confirmed: ${confirmed.id} — total ${confirmed.total} ${confirmed.currency}`);
What’s next?
- Authentication guide — token-based vs cookie-based auth modes
- Error handling guide — typed errors and retry strategies
- React components — drop-in SeatMap, SessionPicker, and OrderSummary
- Templates — full booking apps ready to deploy