Skip to main content

ServerClient

@ticketlayer/live


@ticketlayer/live / server / ServerClient

Interface: ServerClient

Defined in: server.ts:79

Methods

clearCache()

clearCache(): void;

Defined in: server.ts:97

Drop every cached response (and the domain-resolved credential).

Returns

void


get()

get<T>(path: string, opts?: ServerRequestOptions): Promise<T>;

Defined in: server.ts:95

GET any Live path and return the unwrapped JSend data. Cached like the reads above.

Type Parameters

Type Parameter
T

Parameters

ParameterType
pathstring
opts?ServerRequestOptions

Returns

Promise<T>

Properties

events

events: {
get: Promise<{
currency: string | null;
description: string | null;
heroImageUrl: string | null;
id: string;
imageUrl: string | null;
name: string;
occurrences: {
endDate: string;
endsAt: string | null;
endTime: string;
id: string;
startDate: string;
startsAt: string | null;
startTime: string;
status: string;
ticketTypes: {
categoryId: string;
categoryName: string;
currency: string;
description: string | null;
ticketTypeId: string;
ticketTypeName: string;
unitPrice: number;
}[];
timezone: string;
}[];
presentation: | {
buttonSize?: "small" | "medium" | "large";
cinemaGradient?: {
position: "bottom" | "center";
strength: 20 | 50 | 70;
};
heroLayout?: {
size: "small" | "medium" | "large";
type: "hero" | "cinema";
};
navbar?: {
transparent?: boolean;
};
twoColumnSplit?: [number, number];
}
| null;
priceFrom: number | null;
shortDescription: string | null;
status: string;
subtitle: string | null;
timezone: string;
venueCity: string | null;
venueId: string | null;
venueName: string | null;
}>;
list: Promise<{
currency: string | null;
eventId: string;
id: string;
imageUrl: string | null;
name: string | null;
nextOccurrenceAt: string | null;
priceFrom: number | null;
saleEndsAt: string | null;
saleStartsAt: string | null;
shortDescription: string | null;
subtitle: string | null;
venueCity: string | null;
venueName: string | null;
}[]>;
};

Defined in: server.ts:80

get()

get(eventId: string, opts?: ServerRequestOptions): Promise<{
currency: string | null;
description: string | null;
heroImageUrl: string | null;
id: string;
imageUrl: string | null;
name: string;
occurrences: {
endDate: string;
endsAt: string | null;
endTime: string;
id: string;
startDate: string;
startsAt: string | null;
startTime: string;
status: string;
ticketTypes: {
categoryId: string;
categoryName: string;
currency: string;
description: string | null;
ticketTypeId: string;
ticketTypeName: string;
unitPrice: number;
}[];
timezone: string;
}[];
presentation: | {
buttonSize?: "small" | "medium" | "large";
cinemaGradient?: {
position: "bottom" | "center";
strength: 20 | 50 | 70;
};
heroLayout?: {
size: "small" | "medium" | "large";
type: "hero" | "cinema";
};
navbar?: {
transparent?: boolean;
};
twoColumnSplit?: [number, number];
}
| null;
priceFrom: number | null;
shortDescription: string | null;
status: string;
subtitle: string | null;
timezone: string;
venueCity: string | null;
venueId: string | null;
venueName: string | null;
}>;

One storefront event detail. Throws LiveAPIError (404) when not listed.

Parameters
ParameterType
eventIdstring
opts?ServerRequestOptions
Returns

Promise<{ currency: string | null; description: string | null; heroImageUrl: string | null; id: string; imageUrl: string | null; name: string; occurrences: { endDate: string; endsAt: string | null; endTime: string; id: string; startDate: string; startsAt: string | null; startTime: string; status: string; ticketTypes: { categoryId: string; categoryName: string; currency: string; description: string | null; ticketTypeId: string; ticketTypeName: string; unitPrice: number; }[]; timezone: string; }[]; presentation: | { buttonSize?: "small" | "medium" | "large"; cinemaGradient?: { position: "bottom" | "center"; strength: 20 | 50 | 70; }; heroLayout?: { size: "small" | "medium" | "large"; type: "hero" | "cinema"; }; navbar?: { transparent?: boolean; }; twoColumnSplit?: [number, number]; } | null; priceFrom: number | null; shortDescription: string | null; status: string; subtitle: string | null; timezone: string; venueCity: string | null; venueId: string | null; venueName: string | null; }>

list()

list(opts?: ServerRequestOptions): Promise<{
currency: string | null;
eventId: string;
id: string;
imageUrl: string | null;
name: string | null;
nextOccurrenceAt: string | null;
priceFrom: number | null;
saleEndsAt: string | null;
saleStartsAt: string | null;
shortDescription: string | null;
subtitle: string | null;
venueCity: string | null;
venueName: string | null;
}[]>;

The channel's active listings (event card summaries).

Parameters
ParameterType
opts?ServerRequestOptions
Returns

Promise<{ currency: string | null; eventId: string; id: string; imageUrl: string | null; name: string | null; nextOccurrenceAt: string | null; priceFrom: number | null; saleEndsAt: string | null; saleStartsAt: string | null; shortDescription: string | null; subtitle: string | null; venueCity: string | null; venueName: string | null; }[]>


session

session: {
create: Promise<ServerSession>;
};

Defined in: server.ts:90

create()

create(opts?: ServerRequestOptions): Promise<ServerSession>;

Mint a Live session for this channel (POST /session). Never cached.

Parameters
ParameterType
opts?ServerRequestOptions
Returns

Promise<ServerSession>


theme

theme: {
get: Promise<{
brand: {
displayName?: string;
faviconUrl?: string;
logoDarkUrl?: string;
logoUrl?: string;
};
colors: {
accent?: string;
accentForeground?: string;
background?: string;
border?: string;
destructive?: string;
destructiveForeground?: string;
foreground?: string;
input?: string;
muted?: string;
mutedForeground?: string;
primary?: string;
primaryForeground?: string;
ring?: string;
secondary?: string;
secondaryForeground?: string;
success?: string;
successForeground?: string;
warning?: string;
warningForeground?: string;
};
createdAt: string;
description: string | null;
design: | {
cinemaGradient?: {
position: "bottom" | "center";
strength: 20 | 50 | 70;
};
heroLayout?: {
size: "small" | "medium" | "large";
type: "hero" | "cinema";
};
}
| null;
extendsThemeId: string | null;
id: string;
isActive: boolean;
isBaseTheme: boolean;
name: string;
organisationId: string;
shape: {
radiusFull?: string;
radiusLg?: string;
radiusMd?: string;
radiusNone?: string;
radiusSm?: string;
};
typography: {
baseSize?: string;
fontFamily?: string;
fontFamilyMono?: string;
scaleRatio?: number;
};
updatedAt: string;
}>;
};

Defined in: server.ts:86

get()

get(opts?: ServerRequestOptions): Promise<{
brand: {
displayName?: string;
faviconUrl?: string;
logoDarkUrl?: string;
logoUrl?: string;
};
colors: {
accent?: string;
accentForeground?: string;
background?: string;
border?: string;
destructive?: string;
destructiveForeground?: string;
foreground?: string;
input?: string;
muted?: string;
mutedForeground?: string;
primary?: string;
primaryForeground?: string;
ring?: string;
secondary?: string;
secondaryForeground?: string;
success?: string;
successForeground?: string;
warning?: string;
warningForeground?: string;
};
createdAt: string;
description: string | null;
design: | {
cinemaGradient?: {
position: "bottom" | "center";
strength: 20 | 50 | 70;
};
heroLayout?: {
size: "small" | "medium" | "large";
type: "hero" | "cinema";
};
}
| null;
extendsThemeId: string | null;
id: string;
isActive: boolean;
isBaseTheme: boolean;
name: string;
organisationId: string;
shape: {
radiusFull?: string;
radiusLg?: string;
radiusMd?: string;
radiusNone?: string;
radiusSm?: string;
};
typography: {
baseSize?: string;
fontFamily?: string;
fontFamilyMono?: string;
scaleRatio?: number;
};
updatedAt: string;
}>;

The channel's resolved theme. Throws LiveAPIError (404) when none is assigned.

Parameters
ParameterType
opts?ServerRequestOptions
Returns

Promise<{ brand: { displayName?: string; faviconUrl?: string; logoDarkUrl?: string; logoUrl?: string; }; colors: { accent?: string; accentForeground?: string; background?: string; border?: string; destructive?: string; destructiveForeground?: string; foreground?: string; input?: string; muted?: string; mutedForeground?: string; primary?: string; primaryForeground?: string; ring?: string; secondary?: string; secondaryForeground?: string; success?: string; successForeground?: string; warning?: string; warningForeground?: string; }; createdAt: string; description: string | null; design: | { cinemaGradient?: { position: "bottom" | "center"; strength: 20 | 50 | 70; }; heroLayout?: { size: "small" | "medium" | "large"; type: "hero" | "cinema"; }; } | null; extendsThemeId: string | null; id: string; isActive: boolean; isBaseTheme: boolean; name: string; organisationId: string; shape: { radiusFull?: string; radiusLg?: string; radiusMd?: string; radiusNone?: string; radiusSm?: string; }; typography: { baseSize?: string; fontFamily?: string; fontFamilyMono?: string; scaleRatio?: number; }; updatedAt: string; }>