UNPKG

@objectiv/plugin-application-context

Version:

Plugin for Objectiv trackers to automatically generate and attach ApplicationContext to all Events

27 lines (24 loc) 939 B
import { ApplicationContext } from '@objectiv/schema'; import { TrackerPluginInterface, TrackerInterface, ContextsConfig } from '@objectiv/tracker-core'; /** * The ApplicationContextPlugin adds an ApplicationContext as GlobalContext before events are transported. * ApplicationContext Validation is performed by OpenTaxonomyValidationPlugin */ declare class ApplicationContextPlugin implements TrackerPluginInterface { readonly pluginName = "ApplicationContextPlugin"; initialized: boolean; applicationContext?: ApplicationContext; /** * Generates a ApplicationContext with the Tracker's applicationId. */ initialize(tracker: TrackerInterface): void; /** * Add the ApplicationContext to the Event's Global Contexts */ enrich(contexts: Required<ContextsConfig>): void; /** * Make this plugin always usable */ isUsable(): boolean; } export { ApplicationContextPlugin };