Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.67 KB

File metadata and controls

27 lines (19 loc) · 1.67 KB

Home > @snowplow/node-tracker > PayloadBuilder

PayloadBuilder interface

Interface for mutable object encapsulating tracker payload

Signature:

interface PayloadBuilder 

Properties

Property Type Description
add (key: string, value: unknown) => void Adds an entry to the Payload
addContextEntity (entity: SelfDescribingJson) => void Caches a context entity to be added to payload on build
addDict (dict: Payload) => void Merges a payload into the existing payload
addJson (keyIfEncoded: string, keyIfNotEncoded: string, json: Record<string, unknown>) => void Caches a JSON object to be added to payload on build
build () => Payload Builds and returns the Payload
getJson () => EventJson Gets all JSON objects added to payload
getPayload () => Payload Gets the current payload, before cached JSON is processed
withJsonProcessor (jsonProcessor: JsonProcessor) => void Adds a function which will be executed when building the payload to process the JSON which has been added to this payload