export type Context = 'website' | 'product'; export interface CompanyInfo { /** Your own unique id for the company. If omitted, Overcentric generates one. */ id?: string; name?: string; website?: string; } export interface UserInfo { name?: string; email?: string; /** The company/team/account this user belongs to. */ company?: CompanyInfo; } /** * Conditions that must ALL hold before the visitor identification script is * loaded. Every field is optional: an omitted field is not gated on, so an * empty object identifies every visitor. Normally supplied by the config API. */ export interface VisitorIdConditions { /** * Minimum time the visitor must spend on the site before identifying them, * in milliseconds. Accumulated across all pages and reloads of the visit; * only counts time the tab is actually visible. */ minTimeOnSiteMs?: number; /** * ISO 3166-1 alpha-2 country codes to identify visitors from, e.g. * ["US", "CA", "GB"]. Matched case-insensitively against the country the * config API resolved for this visitor. If the country is unknown, the * condition is treated as unmet. */ countries?: string[]; /** * URL substrings, e.g. ["/contact", "/pricing"]. Satisfied once the visitor * is on a page matching any of them; re-checked on SPA navigation. */ pagePatterns?: string[]; } export interface InitOptions { context: Context; basePath?: string; debugMode?: boolean; enableRecording?: boolean; enableErrorCapture?: boolean; projectURL?: string; enableVisitorId?: boolean; /** Conditions gating visitor identification. Omitted = identify every visitor. */ visitorIdConditions?: VisitorIdConditions; /** ISO 3166-1 alpha-2 country resolved for this visitor by the config API. */ visitorCountry?: string; ignoredNetworkErrorUrlPatterns?: string[]; recordingBlockUrlPatterns?: string[]; } declare global { interface Window { overcentric: any; overcentricContext?: Context | null; overcentricProjectId?: string; overcentricInitialized?: boolean; } }