Methods

Contributor Covenant Code of Conduct.

track

Sends a track event to server.

track: (typeName: string, payload?: EventPayload) => Promise
ParamTypeDescription
typeNamestringevent name
payload?EventPayloadevent payload

set

Sets a permanent properties that will be persisted across sessions. On every track() call those properties will be merged with payload parameter.

set(properties: Record<string, any>, opts?: { eventType?: string, persist?: boolean })
ParamTypeDescription
propertiesRecord<string, any>set properties
opts{ eventType?: string, persist?: boolean }eventType - apply permanent properties to only certain event type (applied to all types by default)
persist - persist properties across sessions (in cookies). True by default

unset

Unsets a permanent properties added with set().

unset(propertyName: string, opts: { eventType?: string, persist?: boolean })
ParamTypeDescription
propertyNamestringproperty to unset
opts{ eventType?: string, persist?: boolean }eventType - apply permanent properties to only certain event type (applied to all types by default)
persist - persist properties across sessions (in cookies). True by default