import { ProductAnalyticsOptions } from '../types/types'; import { initComponents } from '../utils/utils'; import { ContentsquareModule } from './nativeModules'; let storedProductAnalyticsOptions: ProductAnalyticsOptions | undefined; export const start = (): void => { ContentsquareModule.start(true); initComponents(); }; /** * Configures product analytics for the Contentsquare SDK. * * This function initializes the product analytics module with the specified environment ID * and optional configuration options. * * @param envId - The environment identifier for the product analytics configuration * @param productAnalyticsOptions - Optional configuration options for product analytics * @returns void */ export const configureProductAnalytics = ( envId: string, productAnalyticsOptions?: ProductAnalyticsOptions ): void => { const defaultOptions = productAnalyticsOptions ?? {}; storedProductAnalyticsOptions = defaultOptions; ContentsquareModule.configureProductAnalytics(envId, defaultOptions); }; export const getProductAnalyticsOptions = (): | ProductAnalyticsOptions | undefined => { return storedProductAnalyticsOptions; };