617 B22 lines
Blame
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8import type {Tracker} from 'isl-server/src/analytics/tracker';
9
10declare global {
11 interface Window {
12 globalIslClientTracker: Tracker<Record<string, never>>;
13 }
14}
15/**
16 * Globally access analytics tracker, to prevent cyclical imports.
17 * Should technically only be nullable if used at the top level.
18 */
19export function getTracker(): Tracker<Record<string, never>> | undefined {
20 return window.globalIslClientTracker;
21}
22