Skip to main content

node-tracker.emitter

Home > @snowplow/node-tracker > Emitter

Emitter interface

Emitter is responsible for sending events to the collector. It manages the event queue and sends events in batches depending on configuration.

Signature:
interface Emitter 

Properties

PropertyTypeDescription
flush() => Promise<void>Forces the emitter to send all events in the event store to the collector.
input(payload: Payload) => Promise<void>Adds a payload to the event store or sends it to the collector.
setAnonymousTracking(anonymous: boolean) => voidSets the server anonymization flag.
setBufferSize(bufferSize: number) => voidUpdates the buffer size of the emitter.
setCollectorUrl(url: string) => voidUpdates the collector URL to which events will be sent.