Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Everything the client needs from the app around it.

    interface ControlClientPorts {
        socketUrl: string;
        token: string | null;
        invoke: (method: string, params: unknown[]) => unknown;
        subscribe: (
            event: string,
            listener: (payload: unknown) => void,
        ) => () => void;
        events: EventGroup;
        openSocket?: (url: string) => ControlSocketLike;
        now?: () => number;
    }
    Index
    socketUrl: string

    Resolved socket URL (already validated by normalizeControlSocketUrl).

    token: string | null

    Shared secret to present as ?token=, or null for an open hub.

    invoke: (method: string, params: unknown[]) => unknown

    Call an embedder method. May return a value or a promise, and may throw — LuxarApp throws ... called before init() for most methods, and that error is the honest answer to send back.

    subscribe: (event: string, listener: (payload: unknown) => void) => () => void

    Attach an embedder event listener, returning its unsubscribe.

    events: EventGroup

    Teardown registry. The client registers its socket and timers here.

    openSocket?: (url: string) => ControlSocketLike

    Socket factory. Defaults to the platform WebSocket.

    now?: () => number

    Clock, injectable so a test can drive the camera throttle.