Essential methods of Ninetailed that submit events to the Experience API. See the dedicated documentation on these events
(enable: boolean) => void
Turn debug mode on or off. Debug mode logs information about whether a a profile's assignment to an experience and its variants.
(payload: ElementSeenPayload, options?: ObserveOptions) => void
Register a DOM element to be tracked by any plugins attached to the Ninetailed instance. Your plugin tracking events will fire when any part of the element has been visible within the user's viewport for at least the amount of time specified by the
trackingComponentThreshold configuration option on the Ninetailed instance. Internally calls
(onIsInitialized: () => void) => void
Supply a callback function to execute on instantiation of the class instance
(cb: (profile: ProfileState) => void) => () => void
Supply a callback function that is executed each time the profile changes. The callback function has access to the changed profile.
Additionally, the callback function you supply will be immediately invoked when first calling onProfileChange using the current profile state.
Read the plugins attached to the Ninetailed instance and/or invoke any methods attached to them.
from: "api" | "hydrated",
profile: Profile | null,
status: "error" | "loading" | "success",
Metadata about loading state of a profile and, once loaded, the current profile state.
(properties: ElementSeenPayload) => Promise<void>
Immediately send any connected plugin tracking calls for a the supplied element. Called by
(element: Element) => void
Unregister an element for tracking. This is the clean up compliment to