addons/isl/src/analytics/globalTracker.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import type {Tracker} from 'isl-server/src/analytics/tracker';
b69ab319
b69ab3110declare global {
b69ab3111 interface Window {
b69ab3112 globalIslClientTracker: Tracker<Record<string, never>>;
b69ab3113 }
b69ab3114}
b69ab3115/**
b69ab3116 * Globally access analytics tracker, to prevent cyclical imports.
b69ab3117 * Should technically only be nullable if used at the top level.
b69ab3118 */
b69ab3119export function getTracker(): Tracker<Record<string, never>> | undefined {
b69ab3120 return window.globalIslClientTracker;
b69ab3121}