@ninetailed/experience.js-plugin-insights
Version:
Ninetailed SDK plugin for Ninetailed Insights
34 lines (33 loc) • 1.76 kB
TypeScript
import { COMPONENT, PROFILE_CHANGE, PAGE_HIDDEN, type ProfileChangedPayload, type InterestedInSeenElements, type InterestedInProfileChange, type InterestedInHiddenPage, type AcceptsCredentials, type Credentials, AnalyticsInstance } from '@ninetailed/experience.js';
import { type ComponentViewEvent } from '@ninetailed/experience.js-shared';
import type { EventBuilder, InterestedInSeenVariables, RequiresEventBuilder } from '@ninetailed/experience.js';
import { ElementSeenPayload, VariableSeenPayload, EventHandler, NinetailedPlugin } from '@ninetailed/experience.js-plugin-analytics';
export declare class NinetailedInsightsPlugin extends NinetailedPlugin implements InterestedInSeenElements, InterestedInSeenVariables, InterestedInProfileChange, InterestedInHiddenPage, AcceptsCredentials, RequiresEventBuilder {
name: string;
private seenElements;
private seenVariables;
private profile?;
private events;
private eventsQueue;
private static MAX_EVENTS;
private insightsApiClient?;
private readonly insightsApiClientUrl?;
private instance?;
private eventBuilder?;
constructor({ url }?: {
url?: string;
});
initialize: ({ instance }: {
instance: AnalyticsInstance;
}) => Promise<void>;
onHasSeenElement: EventHandler<ElementSeenPayload>;
[COMPONENT]: EventHandler<ComponentViewEvent>;
onHasSeenVariable: EventHandler<VariableSeenPayload>;
[PROFILE_CHANGE]: EventHandler<ProfileChangedPayload>;
[PAGE_HIDDEN]: () => void;
private createEventsBatch;
private shouldFlushEventsQueue;
private flushEventsQueue;
setCredentials(credentials: Credentials): void;
setEventBuilder(eventBuilder: EventBuilder): void;
}