Skip to main content

browser-tracker.coreplugin

Home > @snowplow/browser-tracker > CorePlugin

CorePlugin interface

Interface which defines Core Plugins

Signature:
interface CorePlugin 

Properties

PropertyTypeDescription
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
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