Skip to content
Docs
Reference

Interface: ServerClient

Interface: ServerClient in @ticketlayer/live.

@ticketlayer/live


@ticketlayer/live / server / ServerClient

Defined in: server.ts:95

Methods#

clearCache()#

clearCache(): void;

Defined in: server.ts:113

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

Returns#

void


get()#

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

Defined in: server.ts:111

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<{
     availability:   | {
        opensAt: string | null;
        state:   | "on_sale"
           | "not_yet_on_sale"
           | "off_sale"
           | "sold_out"
           | "locked"
           | "hidden"
           | null;
      }
        | null;
     currency: string | null;
     description: string | null;
     heroImageUrl: string | null;
     id: string;
     imageUrl: string | null;
     listing: {
        closesAt: string | null;
        opensAt: string | null;
        sellable: boolean;
     };
     name: string;
     occurrences: {
        availability: {
           closesAt: string | null;
           opensAt: string | null;
           reason:   | "SALE_CLOSED"
              | "NOT_AVAILABLE"
              | "SOLD_OUT"
              | "SALE_NOT_OPEN"
              | "TAG_REQUIRED"
              | null;
           state:   | "on_sale"
              | "not_yet_on_sale"
              | "off_sale"
              | "sold_out"
              | "locked"
              | "hidden";
        };
        endDate: string;
        endsAt: string | null;
        endTime: string;
        id: string;
        lockedTicketTypes: {
           availability: {
              closesAt: string | null;
              opensAt: string | null;
              reason:   | "SALE_CLOSED"
                 | "NOT_AVAILABLE"
                 | "SOLD_OUT"
                 | "SALE_NOT_OPEN"
                 | "TAG_REQUIRED"
                 | null;
              state:   | "on_sale"
                 | "not_yet_on_sale"
                 | "off_sale"
                 | "sold_out"
                 | "locked"
                 | "hidden";
           };
           categoryId: string;
           categoryName: string;
           currency: string;
           description: string | null;
           limits: {
              maxPerOrder: number;
              minPerOrder: number;
           };
           price: {
              currency: string;
              faceValue: number;
              fees: {
                 amount: number;
                 basis: ... | ...;
                 code: string;
                 label: string;
                 rate: ... | ...;
              }[];
              headline: {
                 allIn: boolean;
                 amount: number;
              };
              total: number;
           };
           remaining: {
              bucket: "none" | "available" | "limited" | "few" | null;
           };
           ticketTypeId: string;
           ticketTypeName: string;
           unitPrice: number;
           unlock:   | {
              code: boolean;
              howTo: {
                 products: ...[];
              };
              tags: {
                 label: ...;
              }[];
              unlocked: boolean;
              visibility: "locked" | "hidden";
            }
              | null;
        }[];
        startDate: string;
        startsAt: string | null;
        startTime: string;
        status: string;
        ticketTypes: {
           availability: {
              closesAt: string | null;
              opensAt: string | null;
              reason:   | "SALE_CLOSED"
                 | "NOT_AVAILABLE"
                 | "SOLD_OUT"
                 | "SALE_NOT_OPEN"
                 | "TAG_REQUIRED"
                 | null;
              state:   | "on_sale"
                 | "not_yet_on_sale"
                 | "off_sale"
                 | "sold_out"
                 | "locked"
                 | "hidden";
           };
           categoryId: string;
           categoryName: string;
           currency: string;
           description: string | null;
           limits: {
              maxPerOrder: number;
              minPerOrder: number;
           };
           price: {
              currency: string;
              faceValue: number;
              fees: {
                 amount: number;
                 basis: ... | ...;
                 code: string;
                 label: string;
                 rate: ... | ...;
              }[];
              headline: {
                 allIn: boolean;
                 amount: number;
              };
              total: number;
           };
           remaining: {
              bucket: "none" | "available" | "limited" | "few" | null;
           };
           ticketTypeId: string;
           ticketTypeName: string;
           unitPrice: number;
           unlock:   | {
              code: boolean;
              howTo: {
                 products: ...[];
              };
              tags: {
                 label: ...;
              }[];
              unlocked: boolean;
              visibility: "locked" | "hidden";
            }
              | null;
        }[];
        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;
     prices:   | {
        currency: string | null;
        feesIncluded: true;
        from: number | null;
        to: number | null;
      }
        | null;
     shortDescription: string | null;
     status: string;
     subtitle: string | null;
     timezone: string;
     venueCity: string | null;
     venueId: string | null;
     venueName: string | null;
  }>;
  list: Promise<{
     availability:   | {
        opensAt: string | null;
        state:   | "on_sale"
           | "not_yet_on_sale"
           | "off_sale"
           | "sold_out"
           | "locked"
           | "hidden"
           | null;
      }
        | null;
     closesAt: string | null;
     currency: string | null;
     eventId: string;
     id: string;
     imageUrl: string | null;
     name: string | null;
     nextOccurrenceAt: string | null;
     opensAt: string | null;
     priceFrom: number | null;
     prices:   | {
        currency: string | null;
        feesIncluded: true;
        from: number | null;
        to: number | null;
      }
        | null;
     sellable: boolean;
     shortDescription: string | null;
     subtitle: string | null;
     venueCity: string | null;
     venueName: string | null;
  }[]>;
};

Defined in: server.ts:96

get()#

get(eventId: string, opts?: ServerRequestOptions): Promise<{
  availability:   | {
     opensAt: string | null;
     state:   | "on_sale"
        | "not_yet_on_sale"
        | "off_sale"
        | "sold_out"
        | "locked"
        | "hidden"
        | null;
   }
     | null;
  currency: string | null;
  description: string | null;
  heroImageUrl: string | null;
  id: string;
  imageUrl: string | null;
  listing: {
     closesAt: string | null;
     opensAt: string | null;
     sellable: boolean;
  };
  name: string;
  occurrences: {
     availability: {
        closesAt: string | null;
        opensAt: string | null;
        reason:   | "SALE_CLOSED"
           | "NOT_AVAILABLE"
           | "SOLD_OUT"
           | "SALE_NOT_OPEN"
           | "TAG_REQUIRED"
           | null;
        state:   | "on_sale"
           | "not_yet_on_sale"
           | "off_sale"
           | "sold_out"
           | "locked"
           | "hidden";
     };
     endDate: string;
     endsAt: string | null;
     endTime: string;
     id: string;
     lockedTicketTypes: {
        availability: {
           closesAt: string | null;
           opensAt: string | null;
           reason:   | "SALE_CLOSED"
              | "NOT_AVAILABLE"
              | "SOLD_OUT"
              | "SALE_NOT_OPEN"
              | "TAG_REQUIRED"
              | null;
           state:   | "on_sale"
              | "not_yet_on_sale"
              | "off_sale"
              | "sold_out"
              | "locked"
              | "hidden";
        };
        categoryId: string;
        categoryName: string;
        currency: string;
        description: string | null;
        limits: {
           maxPerOrder: number;
           minPerOrder: number;
        };
        price: {
           currency: string;
           faceValue: number;
           fees: {
              amount: number;
              basis: ... | ...;
              code: string;
              label: string;
              rate: ... | ...;
           }[];
           headline: {
              allIn: boolean;
              amount: number;
           };
           total: number;
        };
        remaining: {
           bucket: "none" | "available" | "limited" | "few" | null;
        };
        ticketTypeId: string;
        ticketTypeName: string;
        unitPrice: number;
        unlock:   | {
           code: boolean;
           howTo: {
              products: ...[];
           };
           tags: {
              label: ...;
           }[];
           unlocked: boolean;
           visibility: "locked" | "hidden";
         }
           | null;
     }[];
     startDate: string;
     startsAt: string | null;
     startTime: string;
     status: string;
     ticketTypes: {
        availability: {
           closesAt: string | null;
           opensAt: string | null;
           reason:   | "SALE_CLOSED"
              | "NOT_AVAILABLE"
              | "SOLD_OUT"
              | "SALE_NOT_OPEN"
              | "TAG_REQUIRED"
              | null;
           state:   | "on_sale"
              | "not_yet_on_sale"
              | "off_sale"
              | "sold_out"
              | "locked"
              | "hidden";
        };
        categoryId: string;
        categoryName: string;
        currency: string;
        description: string | null;
        limits: {
           maxPerOrder: number;
           minPerOrder: number;
        };
        price: {
           currency: string;
           faceValue: number;
           fees: {
              amount: number;
              basis: ... | ...;
              code: string;
              label: string;
              rate: ... | ...;
           }[];
           headline: {
              allIn: boolean;
              amount: number;
           };
           total: number;
        };
        remaining: {
           bucket: "none" | "available" | "limited" | "few" | null;
        };
        ticketTypeId: string;
        ticketTypeName: string;
        unitPrice: number;
        unlock:   | {
           code: boolean;
           howTo: {
              products: ...[];
           };
           tags: {
              label: ...;
           }[];
           unlocked: boolean;
           visibility: "locked" | "hidden";
         }
           | null;
     }[];
     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;
  prices:   | {
     currency: string | null;
     feesIncluded: true;
     from: number | null;
     to: number | null;
   }
     | 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<{ availability: | { opensAt: string | null; state: | "on_sale" | "not_yet_on_sale" | "off_sale" | "sold_out" | "locked" | "hidden" | null; } | null; currency: string | null; description: string | null; heroImageUrl: string | null; id: string; imageUrl: string | null; listing: { closesAt: string | null; opensAt: string | null; sellable: boolean; }; name: string; occurrences: { availability: { closesAt: string | null; opensAt: string | null; reason: | "SALE_CLOSED" | "NOT_AVAILABLE" | "SOLD_OUT" | "SALE_NOT_OPEN" | "TAG_REQUIRED" | null; state: | "on_sale" | "not_yet_on_sale" | "off_sale" | "sold_out" | "locked" | "hidden"; }; endDate: string; endsAt: string | null; endTime: string; id: string; lockedTicketTypes: { availability: { closesAt: string | null; opensAt: string | null; reason: | "SALE_CLOSED" | "NOT_AVAILABLE" | "SOLD_OUT" | "SALE_NOT_OPEN" | "TAG_REQUIRED" | null; state: | "on_sale" | "not_yet_on_sale" | "off_sale" | "sold_out" | "locked" | "hidden"; }; categoryId: string; categoryName: string; currency: string; description: string | null; limits: { maxPerOrder: number; minPerOrder: number; }; price: { currency: string; faceValue: number; fees: { amount: number; basis: ... | ...; code: string; label: string; rate: ... | ...; }[]; headline: { allIn: boolean; amount: number; }; total: number; }; remaining: { bucket: "none" | "available" | "limited" | "few" | null; }; ticketTypeId: string; ticketTypeName: string; unitPrice: number; unlock: | { code: boolean; howTo: { products: ...[]; }; tags: { label: ...; }[]; unlocked: boolean; visibility: "locked" | "hidden"; } | null; }[]; startDate: string; startsAt: string | null; startTime: string; status: string; ticketTypes: { availability: { closesAt: string | null; opensAt: string | null; reason: | "SALE_CLOSED" | "NOT_AVAILABLE" | "SOLD_OUT" | "SALE_NOT_OPEN" | "TAG_REQUIRED" | null; state: | "on_sale" | "not_yet_on_sale" | "off_sale" | "sold_out" | "locked" | "hidden"; }; categoryId: string; categoryName: string; currency: string; description: string | null; limits: { maxPerOrder: number; minPerOrder: number; }; price: { currency: string; faceValue: number; fees: { amount: number; basis: ... | ...; code: string; label: string; rate: ... | ...; }[]; headline: { allIn: boolean; amount: number; }; total: number; }; remaining: { bucket: "none" | "available" | "limited" | "few" | null; }; ticketTypeId: string; ticketTypeName: string; unitPrice: number; unlock: | { code: boolean; howTo: { products: ...[]; }; tags: { label: ...; }[]; unlocked: boolean; visibility: "locked" | "hidden"; } | null; }[]; 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; prices: | { currency: string | null; feesIncluded: true; from: number | null; to: number | null; } | 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<{
  availability:   | {
     opensAt: string | null;
     state:   | "on_sale"
        | "not_yet_on_sale"
        | "off_sale"
        | "sold_out"
        | "locked"
        | "hidden"
        | null;
   }
     | null;
  closesAt: string | null;
  currency: string | null;
  eventId: string;
  id: string;
  imageUrl: string | null;
  name: string | null;
  nextOccurrenceAt: string | null;
  opensAt: string | null;
  priceFrom: number | null;
  prices:   | {
     currency: string | null;
     feesIncluded: true;
     from: number | null;
     to: number | null;
   }
     | null;
  sellable: boolean;
  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<{ availability: | { opensAt: string | null; state: | "on_sale" | "not_yet_on_sale" | "off_sale" | "sold_out" | "locked" | "hidden" | null; } | null; closesAt: string | null; currency: string | null; eventId: string; id: string; imageUrl: string | null; name: string | null; nextOccurrenceAt: string | null; opensAt: string | null; priceFrom: number | null; prices: | { currency: string | null; feesIncluded: true; from: number | null; to: number | null; } | null; sellable: boolean; shortDescription: string | null; subtitle: string | null; venueCity: string | null; venueName: string | null; }[]>


session#

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

Defined in: server.ts:106

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;
        fontStylesheetUrl?: 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;
     };
     design?:   | {
        buttonSize?: "small" | "medium" | "large";
        cinemaGradient?: {
           position: "bottom" | "center";
           strength: 20 | 50 | 70;
        };
        heroLayout?: {
           size: "small" | "medium" | "large";
           type: "hero" | "cinema";
        };
        modalHeader?: {
           channel?: "hidden" | "blurred" | "plain";
           event?: "blurred" | "plain";
        };
        navbar?: {
           transparent?: boolean;
        };
        twoColumnSplit?: [number, number];
      }
        | null;
     id: string;
     name: string;
     shape: {
        radiusFull?: string;
        radiusLg?: string;
        radiusMd?: string;
        radiusNone?: string;
        radiusSm?: string;
     };
     typography: {
        baseSize?: string;
        fontFamily?: string;
        fontFamilyMono?: string;
        headingFontFamily?: string;
        headingFontWeight?: number;
        scaleRatio?: number;
     };
  }>;
};

Defined in: server.ts:102

get()#

get(opts?: ServerRequestOptions): Promise<{
  brand: {
     displayName?: string;
     faviconUrl?: string;
     fontStylesheetUrl?: 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;
  };
  design?:   | {
     buttonSize?: "small" | "medium" | "large";
     cinemaGradient?: {
        position: "bottom" | "center";
        strength: 20 | 50 | 70;
     };
     heroLayout?: {
        size: "small" | "medium" | "large";
        type: "hero" | "cinema";
     };
     modalHeader?: {
        channel?: "hidden" | "blurred" | "plain";
        event?: "blurred" | "plain";
     };
     navbar?: {
        transparent?: boolean;
     };
     twoColumnSplit?: [number, number];
   }
     | null;
  id: string;
  name: string;
  shape: {
     radiusFull?: string;
     radiusLg?: string;
     radiusMd?: string;
     radiusNone?: string;
     radiusSm?: string;
  };
  typography: {
     baseSize?: string;
     fontFamily?: string;
     fontFamilyMono?: string;
     headingFontFamily?: string;
     headingFontWeight?: number;
     scaleRatio?: number;
  };
}>;

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

Parameters
ParameterType
opts?ServerRequestOptions
Returns

Promise<{ brand: { displayName?: string; faviconUrl?: string; fontStylesheetUrl?: 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; }; design?: | { buttonSize?: "small" | "medium" | "large"; cinemaGradient?: { position: "bottom" | "center"; strength: 20 | 50 | 70; }; heroLayout?: { size: "small" | "medium" | "large"; type: "hero" | "cinema"; }; modalHeader?: { channel?: "hidden" | "blurred" | "plain"; event?: "blurred" | "plain"; }; navbar?: { transparent?: boolean; }; twoColumnSplit?: [number, number]; } | null; id: string; name: string; shape: { radiusFull?: string; radiusLg?: string; radiusMd?: string; radiusNone?: string; radiusSm?: string; }; typography: { baseSize?: string; fontFamily?: string; fontFamilyMono?: string; headingFontFamily?: string; headingFontWeight?: number; scaleRatio?: number; }; }>