import { IntegrationElement } from '@turbo-player/integration-web-component'; /** * Connects Sensic analytics integration to a turbo player integration. * * Sensic (formerly GfK) provides streaming measurement for video content. * This integration automatically tracks playback events and reports them * to Sensic's S2S (Server-to-Server) measurement system. * * @param integration - The integration element to connect to * @param options - Sensic configuration options * @returns A cleanup function to disconnect the integration * * @example * ```ts * import { connectToSensic } from '@turbo-player/integration-analytics/sensic'; * * const disconnect = connectToSensic(integration, { * media: 'your-media-id', * platform: 'web', * country: 'de' * }); * * // Later, to disconnect: * disconnect(); * ``` */ export declare const connectToSensic: (integration: IntegrationElement, options: SensicOptions) => (() => void); /** * Configuration options for Sensic analytics integration */ export declare interface SensicOptions { /** Sensic media identifier */ media: string; /** Platform type: 'web' or 'tv' */ platform: 'web' | 'tv'; /** * Two-letter country code for loading the appropriate Sensic script. * Any country code is supported as long as the corresponding Sensic script exists. * The country code also determines the default data mapping for custom parameters and stream ID. * @example 'at' - Austria (uses GfK AT specific data mapping) * @example 'de' - Germany */ country: string; /** Log level for Sensic SDK console output */ logLevel?: 'none' | 'error' | 'warn' | 'info' | 'log' | 'debug'; /** Optional callback for warning messages */ warnCallback?: (error: Error) => void; /** * Callback to build custom parameters for tracking. * Called on each stream start (VoD content, live content, and linear ads). * Receives the country-specific custom params as input, allowing override/extension. * * @param customParams - The country-specific custom params (e.g., AT params for Austria) * @returns Custom parameters as key-value pairs, or `null`/`undefined` to skip tracking this stream * @default Returns country-specific params unchanged * * @example * ```ts * buildCustomParams: (customParams) => ({ * ...customParams, * genre: integration.content?.genre ?? '', * showId: integration.content?.show?.id ?? '' * }) * ``` */ buildCustomParams?: (customParams: Record) => Record | null | undefined; /** * Callback to build the stream ID for tracking. * Called on each stream start (VoD content, live content, and linear ads). * Receives the country-specific stream ID as input, allowing override. * * @param streamId - The country-specific stream ID * @returns The stream ID to use for tracking * @default Returns country-specific stream ID unchanged * * @example * ```ts * buildStreamId: (streamId) => streamId || integration.content?.id ?? '' * ``` */ buildStreamId?: (streamId: string) => string; } export { }