import type LogRocket from 'logrocket'; /** * LogRocket initialization options */ export type LROptions = Parameters[1] & { /** * unique identifier of the logrocket project * @example 'your-project/your-app' * @default window.emui.logRocketConfig.appId */ appId?: string; /** * indicates if the application is using react framework * @default true */ isReact?: boolean; }; /** * Determines whether the user has consented to session recording based on OneTrust configuration and other signals. * * This function checks for user consent using multiple strategies, in the following order: * 1. If `window.emui.dangerouslyOverrideSessionRecordingConsent` is `true`, force consent ON (test/dev only). Any other value (`false`, `undefined`) defers to the normal sources below — `false` is **not** a force-disable. * 2. If OneTrust is loaded, checks if `window.OnetrustActiveGroups` contains the session recording group ID ('C0003'). * 3. If embedded and OneTrust is not loaded, checks the `analyticsConsent` * query parameter in the current URL (set by the parent via * `buildLogRocketQueryParams`). * 4. If running in an iframe, checks the `analyticsConsent` query parameter in the iframe's src URL. * 5. Defaults to `false` if no consent can be determined. * * Note: When OneTrust is present, the OneTrust consent groups take precedence over URL parameters. * The `analyticsConsent` URL parameter only applies when OneTrust is not loaded. * @returns {boolean} `true` if the user has consented to session recording, `false` otherwise. */ declare const hasUserConsentedToSessionRecording: () => boolean; /** * Builds a URL query string containing LogRocket-related parameters. * * The query parameters include: * - `analyticsConsent`: Indicates whether the user has consented to session recording (`'true'` or `'false'`). * - `lrEnabled`: Indicates whether LogRocket is enabled based on the global configuration (`'true'` or `'false'`). * - `lrAppId`: The LogRocket application ID, or an empty string if not available. * - `lrParentOrigin`: The current window's origin, so a child iframe loaded * with this query string can derive its `parentDomain` even when * cross-origin restrictions block `window.parent.location.origin`. * @returns {string} The constructed query string with LogRocket parameters. */ declare const buildLogRocketQueryParams: () => string; /** * Initialize LogRocket with optional OneTrust integration * * This function handles LogRocket initialization with support for OneTrust consent management. * The initialization behavior depends on the `window.hasOneTrust` flag and consent banner state: * - If `window.hasOneTrust` is true and the consent banner hasn't been seen, waits for 'OTConsentApplied' event (until user interacts with banner) * - If `window.hasOneTrust` is true and the banner was already seen, initializes immediately * - If `window.hasOneTrust` is false or undefined, LogRocket initializes immediately * - Prevents duplicate initialization by checking `window.emui.isLogRocketInitialized` * @example * // With OneTrust (when window.hasOneTrust is true) * initLogRocket({ * appId: 'your-project/your-app', * isReact: true, * rootHostname: '.ice.com', * childDomains: ['https://your-child-domain.com'], * parentDomain: 'https://your-parent-domain.com', * }); * @example * // Without OneTrust (when window.hasOneTrust is false/undefined) * initLogRocket({ * appId: 'your-project/your-app', * }); * @param {LROptions} [options] - LogRocket initialization options * @param {string} [options.appId] - LogRocket application ID * @param {boolean} [options.isReact=true] - Whether the application uses React */ declare const initLogRocket: (options?: LROptions) => void; export { initLogRocket, hasUserConsentedToSessionRecording, buildLogRocketQueryParams, };