UNPKG

@safaricom-mxl/nextjs

Version:

MXL Javascript RUM agent for nextjs

36 lines (33 loc) 1.73 kB
import { MxlAnalyticsOptions, IdentifyPayload, TrackProperties, IncrementPayload, DecrementPayload } from '@safaricom-mxl/browser'; export * from '@safaricom-mxl/browser'; import React from 'react'; type MxlAnalyticsComponentProps = Omit<MxlAnalyticsOptions, 'filter'> & { profileId?: string; cdnUrl?: string; filter?: string; globalProperties?: Record<string, unknown>; }; declare function MXLAnalytics({ profileId, cdnUrl, globalProperties, ...options }: MxlAnalyticsComponentProps): React.JSX.Element; type IdentifyComponentProps = IdentifyPayload; declare function IdentifyComponent(props: IdentifyComponentProps): React.JSX.Element; declare function SetGlobalPropertiesComponent(props: Record<string, unknown>): React.JSX.Element; declare function useMxlAnalytics(): { track: typeof track; screenView: typeof screenView; identify: typeof identify; increment: typeof increment; decrement: typeof decrement; clear: typeof clear; setGlobalProperties: typeof setGlobalProperties; fetchDeviceId: typeof fetchDeviceId; }; declare function setGlobalProperties(properties: Record<string, unknown>): void; declare function track(name: string, properties?: TrackProperties): void; declare function screenView(properties?: TrackProperties): void; declare function screenView(path: string, properties?: TrackProperties): void; declare function identify(payload: IdentifyPayload): void; declare function increment(payload: IncrementPayload): void; declare function decrement(payload: DecrementPayload): void; declare function clear(): void; declare function fetchDeviceId(): Promise<string>; export { IdentifyComponent, MXLAnalytics, SetGlobalPropertiesComponent, useMxlAnalytics };