cryptique-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3580 -0
- package/lib/cjs/index.js +6477 -0
- package/lib/esm/index.js +6475 -0
- package/lib/types/index.d.ts +163 -0
- package/lib/umd/index.js +6483 -0
- package/package.json +57 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cryptique Analytics SDK - TypeScript Definitions
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface CryptiqueOptions {
|
|
6
|
+
siteId: string;
|
|
7
|
+
autoEvents?: boolean;
|
|
8
|
+
disabledPaths?: string[];
|
|
9
|
+
disabledEvents?: string[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AutoEventsConfig {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
disabledPaths: string[];
|
|
15
|
+
disabledEvents: string[];
|
|
16
|
+
availableEvents: string[];
|
|
17
|
+
currentPath: string;
|
|
18
|
+
shouldTrack: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SessionData {
|
|
22
|
+
sessionId: string | null;
|
|
23
|
+
siteId: string;
|
|
24
|
+
userId: string | null;
|
|
25
|
+
startTime: string | null;
|
|
26
|
+
endTime: string | null;
|
|
27
|
+
lastActivity: number | null;
|
|
28
|
+
duration: number;
|
|
29
|
+
pagesViewed: number;
|
|
30
|
+
isBounce: boolean;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Interaction {
|
|
35
|
+
timestamp: string;
|
|
36
|
+
category: string;
|
|
37
|
+
originalCategory: string;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default class CryptiqueSDK {
|
|
42
|
+
/**
|
|
43
|
+
* Initialize the SDK programmatically
|
|
44
|
+
*/
|
|
45
|
+
init(options: CryptiqueOptions): Promise<any> | any;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the SDK instance
|
|
49
|
+
*/
|
|
50
|
+
getInstance(): any | null;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Track a custom event
|
|
54
|
+
*/
|
|
55
|
+
track(eventName: string, properties?: object, options?: object): Promise<void>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Track a custom event (alias for track)
|
|
59
|
+
*/
|
|
60
|
+
trackEvent(eventName: string, properties?: object, options?: object): Promise<void>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Track an auto event
|
|
64
|
+
*/
|
|
65
|
+
trackAutoEvent(eventName: string, autoEventData?: object, elementData?: object): Promise<void>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Connect wallet
|
|
69
|
+
*/
|
|
70
|
+
connectWallet(): Promise<string | null>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Check if wallet is connected
|
|
74
|
+
*/
|
|
75
|
+
isWalletConnected(): Promise<boolean>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Update wallet info
|
|
79
|
+
*/
|
|
80
|
+
updateWalletInfo(): Promise<any>;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Set tracking consent
|
|
84
|
+
*/
|
|
85
|
+
setTrackingConsent(consent: boolean): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get tracking consent
|
|
89
|
+
*/
|
|
90
|
+
getTrackingConsent(): boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get session data
|
|
94
|
+
*/
|
|
95
|
+
getSessionData(): SessionData;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Get chronological interactions
|
|
99
|
+
*/
|
|
100
|
+
getChronologicalInteractions(): Interaction[];
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Sort interactions chronologically (alias)
|
|
104
|
+
*/
|
|
105
|
+
sortInteractionsChronologically(): Interaction[];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Enable auto events
|
|
109
|
+
*/
|
|
110
|
+
enableAutoEvents(): void;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Disable auto events
|
|
114
|
+
*/
|
|
115
|
+
disableAutoEvents(): void;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Set auto events disabled paths
|
|
119
|
+
*/
|
|
120
|
+
setAutoEventsDisabledPaths(paths: string | string[]): void;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Disable specific auto events
|
|
124
|
+
*/
|
|
125
|
+
disableAutoEvent(events: string | string[]): void;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Enable specific auto events
|
|
129
|
+
*/
|
|
130
|
+
enableAutoEvent(events: string | string[]): void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Set auto events disabled events
|
|
134
|
+
*/
|
|
135
|
+
setAutoEventsDisabledEvents(events: string[]): void;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get available auto events
|
|
139
|
+
*/
|
|
140
|
+
getAvailableAutoEvents(): string[];
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Get auto events configuration
|
|
144
|
+
*/
|
|
145
|
+
getAutoEventsConfig(): AutoEventsConfig;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* SDK version
|
|
149
|
+
*/
|
|
150
|
+
version: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Site ID
|
|
154
|
+
*/
|
|
155
|
+
siteId: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Session data
|
|
159
|
+
*/
|
|
160
|
+
sessionData: SessionData;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { CryptiqueSDK };
|