@dotcms/analytics
Version:
Official JavaScript library for Content Analytics with DotCMS.
21 lines (19 loc) • 1.01 kB
TypeScript
import { DotContentAnalyticsConfig } from '../../dotAnalytics/shared/dot-content-analytics.model';
import { ReactElement, ReactNode } from 'react';
interface DotContentAnalyticsProviderProps {
children?: ReactNode;
config: DotContentAnalyticsConfig;
}
/**
* Provider component that initializes and manages DotContentAnalytics instance.
* It makes the analytics functionality available to all child components through React Context.
* This component is responsible for:
* - Initializing the DotContentAnalytics singleton instance with the provided config
* - Making the instance accessible via useContext hook to child components
* - Managing the lifecycle of the analytics instance
*
* @param {DotContentAnalyticsProviderProps} props - Configuration and children to render
* @returns {ReactElement} Provider component that enables analytics tracking
*/
export declare const DotContentAnalyticsProvider: ({ children, config }: DotContentAnalyticsProviderProps) => ReactElement;
export {};