Skip to main content

CreateLiveClientOptions

@ticketlayer/live


@ticketlayer/live / index / CreateLiveClientOptions

Interface: CreateLiveClientOptions

Defined in: createLiveClient.ts:22

Stateful ergonomic layer over the generated LiveClient.

The generated client is stateless REST; Elements and HBO need a stateful, reactive surface (a session-owned cart, cart:updated events, theme application, auth state). This class provides that, COORDINATING with the live-api session - which owns the cartId server-side - rather than holding a second source of truth: on start it loads the session's existing cart, and cart mutations both update local state AND ride the same session upstream.

Extends

Properties

apiVersion?

optional apiVersion?: string;

Defined in: client.ts:70

Override the dated API version sent as TL-Version.

Inherited from

LiveClientConfig.apiVersion


applyTheme?

optional applyTheme?: boolean;

Defined in: createLiveClient.ts:28

Fetch + apply the channel theme on start (default true in the browser).


autoStart?

optional autoStart?: boolean;

Defined in: createLiveClient.ts:26

Bootstrap the session immediately (default true).


baseUrl

baseUrl: string;

Defined in: client.ts:56

Base URL of a Live deployment (or the sales surface directly).

Inherited from

LiveClientConfig.baseUrl


buyModal?

optional buyModal?: boolean;

Defined in: createLiveClient.ts:52

Mount the in-page buy-tickets modal (occurrence → ticket selection) on ui:event-modal-requested. Native Elements overlay, no iframe - works on HBO and embeds alike. Defaults to true in the browser for the published client; set false to opt out.


checkout?

optional checkout?: {
mode: "modal";
} & CheckoutModalOptions;

Defined in: createLiveClient.ts:45

Checkout rendering. 'modal' (third-party embeds) auto-opens the hosted checkout in an iframe overlay on ui:checkout-requested. Omit on HBO, which handles that intent by navigating to /checkout in-page.

Type Declaration

mode
mode: "modal";

domain?

optional domain?: string;

Defined in: createLiveClient.ts:24

Storefront host to resolve the channel from (hosted mode). Defaults to the page host.


elements?

optional elements?: boolean;

Defined in: state/loadElements.ts:18

Enable runtime injection (default false - most hosts import Elements directly).

Inherited from

LoadElementsOptions.elements

elementsUrl?

optional elementsUrl?: string;

Defined in: state/loadElements.ts:20

Override the Elements ESM bundle URL (e.g. a local dist in dev).

Inherited from

LoadElementsOptions.elementsUrl

publish?

optional publish?: boolean;

Defined in: createLiveClient.ts:33

Publish this client on window.Ticketlayer so Elements can find + bind to it (default true in the browser). Set false to keep the client private.


publishableKey?

optional publishableKey?: string;

Defined in: client.ts:66

For embeds/native: the channel's publishable key (tlpk_…).

Inherited from

LiveClientConfig.publishableKey


sessionMode?

optional sessionMode?: "cookie" | "token";

Defined in: client.ts:64

Session transport:

  • 'cookie' (hosted web): the live_session httpOnly cookie travels automatically with credentials: 'include'; no token is held client-side.
  • 'token' (embeds / React Native / native): the session id is held by the SDK and sent as the X-Live-Session header.

Inherited from

LiveClientConfig.sessionMode


sessionToken?

optional sessionToken?: string;

Defined in: createLiveClient.ts:39

Resume an existing session by token (token transport) instead of bootstrapping a new one. Used by the embedded checkout iframe to inherit the parent page's cart/session. Forces sessionMode 'token'.


tokenStorage?

optional tokenStorage?: LiveTokenStorage;

Defined in: client.ts:68

Token storage for 'token' session mode (defaults to in-memory).

Inherited from

LiveClientConfig.tokenStorage