-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsegment.interface.ts
More file actions
66 lines (61 loc) · 1.65 KB
/
segment.interface.ts
File metadata and controls
66 lines (61 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
/**
* Segment configuration from environment
*/
export interface SegmentConfig {
/** Segment CDN URL for loading the analytics script */
cdnUrl: string;
/** Whether analytics is enabled for this environment */
enabled: boolean;
}
/**
* User traits for Segment identify calls
*/
export interface AnalyticsIdentifyTraits {
/** User's email address */
email?: string;
/** User's full name */
name?: string;
/** User's first name */
firstName?: string;
/** User's last name */
lastName?: string;
/** User's username */
username?: string;
}
/**
* Page properties for Segment page calls
*/
export interface AnalyticsPageProperties {
/** Page title */
title?: string;
/** Page URL or path */
path?: string;
/** Additional custom properties */
[key: string]: unknown;
}
/**
* LFX Segment Analytics API interface
* @description Type definitions for LfxSegmentsAnalytics object
*/
export interface LfxSegmentAnalytics {
/** Initialize the analytics instance */
init(): Promise<void>;
/** Track a page view */
page(pageName: string, properties?: Record<string, unknown>): void;
/** Track a custom event */
track(eventName: string, properties?: Record<string, unknown>): void;
/** Identify an Auth0 user */
identifyAuth0User(auth0User: unknown): void;
/** Reset analytics state */
reset(): void;
}
/**
* LFX Segment Analytics class interface
* @description Type definitions for LfxSegmentsAnalytics class
*/
export interface LfxSegmentAnalyticsClass {
/** Get the singleton instance */
getInstance(): LfxSegmentAnalytics;
}