declare const DEFAULT_COLLECT_URL = "https://cavuno.com/api/analytics/collect"; declare const DEFAULT_SCRIPT_URL = "https://cavuno.com/js/metrics.js"; /** Placeholder tenant; collect rewrites from the publishable key. */ declare const PENDING_TENANT_ID = "boards_pending"; declare const WELL_KNOWN_ANALYTICS_SCRIPT_PATH = "/.well-known/cavuno/analytics.js"; declare const WELL_KNOWN_SCRIPT_PATH = "/.well-known/cavuno/analytics.js"; declare const WELL_KNOWN_COLLECT_PATH = "/.well-known/cavuno/collect"; /** * Optional first-party well-known handlers for board origin Workers. * Central collect remains the default when these paths are not mounted. */ declare const WELL_KNOWN_COLLECT_EVENTS_PATH = "/.well-known/cavuno/collect/v0/events"; /** * Handle `/.well-known/cavuno/{analytics.js,collect}` when mounted on a Worker. * Returns null for every other path so the host can fall through. */ declare function matchAnalyticsWellKnown(request: Request): Promise; /** * `@cavuno/board/analytics` — client write surface for board analytics. * * Emits pageviews (via hosted script) and custom events to Cavuno collect. * Uses the board publishable key only; no second analytics credential. */ type AnalyticsInstallOptions = { publishableKey: string; /** Default: Cavuno central collect (self-host safe) */ collectUrl?: string; /** Default: Cavuno-hosted metrics script */ scriptUrl?: string; }; /** * Load the Cavuno-hosted metrics script and remember collect credentials. * Safe to call once per page; subsequent calls update collect targets only. */ declare function install(options: AnalyticsInstallOptions): void; /** * Emit a custom analytics event to Cavuno collect. * Prefer `install` first so pageviews and vitals are also recorded. */ declare function track(action: string, payload?: Record): void; declare const analytics: { install: typeof install; track: typeof track; matchAnalyticsWellKnown: typeof matchAnalyticsWellKnown; DEFAULT_COLLECT_URL: string; DEFAULT_SCRIPT_URL: string; PENDING_TENANT_ID: string; WELL_KNOWN_ANALYTICS_SCRIPT_PATH: string; WELL_KNOWN_SCRIPT_PATH: string; WELL_KNOWN_COLLECT_PATH: string; WELL_KNOWN_COLLECT_EVENTS_PATH: string; }; export { type AnalyticsInstallOptions, DEFAULT_COLLECT_URL, DEFAULT_SCRIPT_URL, PENDING_TENANT_ID, WELL_KNOWN_ANALYTICS_SCRIPT_PATH, WELL_KNOWN_COLLECT_EVENTS_PATH, WELL_KNOWN_COLLECT_PATH, WELL_KNOWN_SCRIPT_PATH, analytics, install, matchAnalyticsWellKnown, track };