Skip to content

js-bao-wss-client


js-bao-wss-client / AnalyticsClient

Interface: AnalyticsClient ​

Analytics API, available as client.analytics. Events are queued locally (and persisted while offline) and delivered to the server in batches; the queue flushes automatically when the connection comes up.

Methods ​

flush() ​

flush(): void

Send the queued analytics events to the server now, rather than waiting for the next automatic flush.

Returns ​

void


logEvent() ​

logEvent(event): void

Queue an analytics event for delivery to the server.

Parameters ​

event ​

AnalyticsEventInput

Returns ​

void


logSnapshot() ​

logSnapshot(context?): void

Queue a state-snapshot event with an optional context object. Does nothing when no signed-in user can be resolved.

Parameters ​

context? ​

Record<string, unknown>

Returns ​

void


setAppVersionOverride() ​

setAppVersionOverride(version): void

Override the app version stamped on subsequently queued events. Pass null or undefined to clear the override.

Parameters ​

version ​

string | null | undefined

Returns ​

void


setPlanOverride() ​

setPlanOverride(plan): void

Override the plan value stamped on subsequently queued events. Pass null or undefined to clear the override.

Parameters ​

plan ​

string | null | undefined

Returns ​

void

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30