Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.87 KB

File metadata and controls

26 lines (18 loc) · 1.87 KB

Home > @snowplow/browser-tracker > CorePlugin

CorePlugin interface

Interface which defines Core Plugins

Signature:

interface CorePlugin 

Properties

Property Type Description
activateCorePlugin? (core: TrackerCore) => void (Optional) Called when the plugin is initialised during the trackerCore construction
afterTrack? (payload: Payload) => void (Optional) Called just after the trackerCore callback fires
beforeTrack? (payloadBuilder: PayloadBuilder) => void (Optional) Called before the filter method is called and before the trackerCore callback fires (if the filter passes)
contexts? () => SelfDescribingJson[] (Optional) Called when constructing the context for each event Useful for adding additional context to events
deactivatePlugin? (core: TrackerCore) => void (Optional) Called when the tracker is being destroyed. Should be used to clean up any resources or listeners that the plugin has created.
filter? (payload: Payload) => boolean (Optional) Called before the payload is sent to the callback to decide whether to send the payload or skip it
logger? (logger: Logger) => void (Optional) Passed a logger instance which can be used to send log information to the active logger