@snowplow/react-native-tracker 2.1.2 → 4.0.2-dev.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.
Files changed (232) hide show
  1. package/LICENSE +29 -203
  2. package/README.md +59 -143
  3. package/dist/index.cjs.d.ts +499 -0
  4. package/dist/index.cjs.js +2656 -0
  5. package/dist/index.cjs.js.map +1 -0
  6. package/dist/index.cjs.min.d.ts +499 -0
  7. package/dist/index.cjs.min.js +63 -0
  8. package/dist/index.cjs.min.js.map +1 -0
  9. package/dist/index.module.d.ts +499 -0
  10. package/dist/index.module.js +250 -0
  11. package/dist/index.module.js.map +1 -0
  12. package/package.json +48 -158
  13. package/.editorconfig +0 -15
  14. package/.eslintignore +0 -6
  15. package/.gitattributes +0 -3
  16. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -29
  17. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  18. package/.github/actions/setup/action.yml +0 -28
  19. package/.github/workflows/build.yml +0 -155
  20. package/.github/workflows/deploy.yml +0 -97
  21. package/.github/workflows/e2e-android.yml +0 -121
  22. package/.github/workflows/e2e-ios.yml +0 -95
  23. package/.github/workflows/snyk.yml +0 -21
  24. package/.gitignore +0 -70
  25. package/.npmignore +0 -60
  26. package/.nvmrc +0 -1
  27. package/.watchmanconfig +0 -1
  28. package/.yarnrc +0 -3
  29. package/CHANGELOG +0 -184
  30. package/CONTRIBUTING.md +0 -80
  31. package/android/build.gradle +0 -110
  32. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  33. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  34. package/android/gradle.properties +0 -5
  35. package/android/gradlew +0 -234
  36. package/android/gradlew.bat +0 -89
  37. package/android/src/main/AndroidManifest.xml +0 -3
  38. package/android/src/main/AndroidManifestNew.xml +0 -2
  39. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerModule.kt +0 -744
  40. package/android/src/main/java/com/snowplow/reactnativetracker/ReactNativeTrackerPackage.kt +0 -17
  41. package/android/src/main/java/com/snowplow/reactnativetracker/util/ConfigUtil.kt +0 -274
  42. package/android/src/main/java/com/snowplow/reactnativetracker/util/EventUtil.kt +0 -233
  43. package/android/src/main/java/com/snowplow/reactnativetracker/util/TrackerVersion.kt +0 -5
  44. package/babel.config.js +0 -3
  45. package/example/.watchmanconfig +0 -1
  46. package/example/Gemfile +0 -6
  47. package/example/android/app/build.gradle +0 -129
  48. package/example/android/app/debug.keystore +0 -0
  49. package/example/android/app/proguard-rules.pro +0 -10
  50. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTest.java +0 -36
  51. package/example/android/app/src/androidTest/java/com/reactnativetrackerexample/DetoxTestAppJUnitRunner.java +0 -21
  52. package/example/android/app/src/debug/AndroidManifest.xml +0 -13
  53. package/example/android/app/src/debug/java/com/reactnativetrackerexample/ReactNativeFlipper.java +0 -75
  54. package/example/android/app/src/main/AndroidManifest.xml +0 -26
  55. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainActivity.java +0 -32
  56. package/example/android/app/src/main/java/com/reactnativetrackerexample/MainApplication.java +0 -62
  57. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
  58. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  59. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  60. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  61. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  62. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  63. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  64. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  65. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  66. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  67. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  68. package/example/android/app/src/main/res/values/strings.xml +0 -3
  69. package/example/android/app/src/main/res/values/styles.xml +0 -9
  70. package/example/android/app/src/release/java/com/reactnativetrackerexample/ReactNativeFlipper.java +0 -20
  71. package/example/android/build.gradle +0 -31
  72. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  73. package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  74. package/example/android/gradle.properties +0 -44
  75. package/example/android/gradlew +0 -244
  76. package/example/android/gradlew.bat +0 -92
  77. package/example/android/settings.gradle +0 -4
  78. package/example/app.json +0 -4
  79. package/example/babel.config.js +0 -17
  80. package/example/detox.config.js +0 -92
  81. package/example/e2e/config.json +0 -10
  82. package/example/e2e/emitEvents.e2e.detox.js +0 -95
  83. package/example/e2e/environment.js +0 -23
  84. package/example/e2e/helpers/microCommands.js +0 -140
  85. package/example/e2e/helpers/microHelpers.js +0 -333
  86. package/example/e2e/helpers/microHelpers.test.js +0 -295
  87. package/example/e2e/helpers/schemas.js +0 -49
  88. package/example/e2e/jest.config.js +0 -16
  89. package/example/e2e/setup.js +0 -4
  90. package/example/e2e/testEvents.micro.test.js +0 -287
  91. package/example/index.js +0 -5
  92. package/example/ios/.xcode.env +0 -11
  93. package/example/ios/Podfile +0 -62
  94. package/example/ios/Podfile.lock +0 -730
  95. package/example/ios/ReactNativeTrackerExample/AppDelegate.h +0 -6
  96. package/example/ios/ReactNativeTrackerExample/AppDelegate.mm +0 -26
  97. package/example/ios/ReactNativeTrackerExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
  98. package/example/ios/ReactNativeTrackerExample/Images.xcassets/Contents.json +0 -6
  99. package/example/ios/ReactNativeTrackerExample/Info.plist +0 -55
  100. package/example/ios/ReactNativeTrackerExample/LaunchScreen.storyboard +0 -47
  101. package/example/ios/ReactNativeTrackerExample/PrivacyInfo.xcprivacy +0 -37
  102. package/example/ios/ReactNativeTrackerExample/main.m +0 -10
  103. package/example/ios/ReactNativeTrackerExample-Bridging-Header.h +0 -3
  104. package/example/ios/ReactNativeTrackerExample.xcodeproj/project.pbxproj +0 -739
  105. package/example/ios/ReactNativeTrackerExample.xcodeproj/xcshareddata/xcschemes/ReactNativeTrackerExample.xcscheme +0 -88
  106. package/example/ios/ReactNativeTrackerExample.xcworkspace/contents.xcworkspacedata +0 -10
  107. package/example/ios/ReactNativeTrackerExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  108. package/example/ios/ReactNativeTrackerExampleTests/Info.plist +0 -24
  109. package/example/ios/ReactNativeTrackerExampleTests/ReactNativeTrackerExampleTests.m +0 -66
  110. package/example/metro.config.js +0 -45
  111. package/example/package.json +0 -54
  112. package/example/react-native.config.js +0 -10
  113. package/example/src/App.js +0 -566
  114. package/example/tsconfig.json +0 -5
  115. package/example/yarn.lock +0 -7703
  116. package/ios/ReactNativeTracker-Bridging-Header.h +0 -2
  117. package/ios/ReactNativeTracker.mm +0 -171
  118. package/ios/ReactNativeTracker.swift +0 -822
  119. package/ios/ReactNativeTracker.xcodeproj/project.pbxproj +0 -301
  120. package/ios/Util/ConfigUtils.swift +0 -209
  121. package/ios/Util/TrackerVersion.swift +0 -3
  122. package/ios/Util/Utilities.swift +0 -37
  123. package/lefthook.yml +0 -11
  124. package/lib/commonjs/api.js +0 -490
  125. package/lib/commonjs/api.js.map +0 -1
  126. package/lib/commonjs/configurations.js +0 -196
  127. package/lib/commonjs/configurations.js.map +0 -1
  128. package/lib/commonjs/constants.js +0 -77
  129. package/lib/commonjs/constants.js.map +0 -1
  130. package/lib/commonjs/events.js +0 -277
  131. package/lib/commonjs/events.js.map +0 -1
  132. package/lib/commonjs/index.js +0 -132
  133. package/lib/commonjs/index.js.map +0 -1
  134. package/lib/commonjs/jsCore.js +0 -427
  135. package/lib/commonjs/jsCore.js.map +0 -1
  136. package/lib/commonjs/native.js +0 -16
  137. package/lib/commonjs/native.js.map +0 -1
  138. package/lib/commonjs/subject.js +0 -235
  139. package/lib/commonjs/subject.js.map +0 -1
  140. package/lib/commonjs/tracker.js +0 -248
  141. package/lib/commonjs/tracker.js.map +0 -1
  142. package/lib/commonjs/types.js +0 -2
  143. package/lib/commonjs/types.js.map +0 -1
  144. package/lib/commonjs/utils.js +0 -72
  145. package/lib/commonjs/utils.js.map +0 -1
  146. package/lib/commonjs/webViewInterface.js +0 -66
  147. package/lib/commonjs/webViewInterface.js.map +0 -1
  148. package/lib/module/api.js +0 -452
  149. package/lib/module/api.js.map +0 -1
  150. package/lib/module/configurations.js +0 -184
  151. package/lib/module/configurations.js.map +0 -1
  152. package/lib/module/constants.js +0 -72
  153. package/lib/module/constants.js.map +0 -1
  154. package/lib/module/events.js +0 -259
  155. package/lib/module/events.js.map +0 -1
  156. package/lib/module/index.js +0 -120
  157. package/lib/module/index.js.map +0 -1
  158. package/lib/module/jsCore.js +0 -424
  159. package/lib/module/jsCore.js.map +0 -1
  160. package/lib/module/native.js +0 -12
  161. package/lib/module/native.js.map +0 -1
  162. package/lib/module/subject.js +0 -222
  163. package/lib/module/subject.js.map +0 -1
  164. package/lib/module/tracker.js +0 -234
  165. package/lib/module/tracker.js.map +0 -1
  166. package/lib/module/types.js +0 -2
  167. package/lib/module/types.js.map +0 -1
  168. package/lib/module/utils.js +0 -66
  169. package/lib/module/utils.js.map +0 -1
  170. package/lib/module/webViewInterface.js +0 -62
  171. package/lib/module/webViewInterface.js.map +0 -1
  172. package/lib/typescript/__tests__/api.test.d.ts +0 -2
  173. package/lib/typescript/__tests__/api.test.d.ts.map +0 -1
  174. package/lib/typescript/__tests__/configurations.test.d.ts +0 -2
  175. package/lib/typescript/__tests__/configurations.test.d.ts.map +0 -1
  176. package/lib/typescript/__tests__/events.test.d.ts +0 -2
  177. package/lib/typescript/__tests__/events.test.d.ts.map +0 -1
  178. package/lib/typescript/__tests__/index.test.d.ts +0 -2
  179. package/lib/typescript/__tests__/index.test.d.ts.map +0 -1
  180. package/lib/typescript/__tests__/jsCore.test.d.ts +0 -2
  181. package/lib/typescript/__tests__/jsCore.test.d.ts.map +0 -1
  182. package/lib/typescript/__tests__/utils.test.d.ts +0 -2
  183. package/lib/typescript/__tests__/utils.test.d.ts.map +0 -1
  184. package/lib/typescript/api.d.ts +0 -240
  185. package/lib/typescript/api.d.ts.map +0 -1
  186. package/lib/typescript/configurations.d.ts +0 -73
  187. package/lib/typescript/configurations.d.ts.map +0 -1
  188. package/lib/typescript/constants.d.ts +0 -64
  189. package/lib/typescript/constants.d.ts.map +0 -1
  190. package/lib/typescript/events.d.ts +0 -115
  191. package/lib/typescript/events.d.ts.map +0 -1
  192. package/lib/typescript/index.d.ts +0 -27
  193. package/lib/typescript/index.d.ts.map +0 -1
  194. package/lib/typescript/jsCore.d.ts +0 -152
  195. package/lib/typescript/jsCore.d.ts.map +0 -1
  196. package/lib/typescript/native.d.ts +0 -4
  197. package/lib/typescript/native.d.ts.map +0 -1
  198. package/lib/typescript/subject.d.ts +0 -91
  199. package/lib/typescript/subject.d.ts.map +0 -1
  200. package/lib/typescript/tracker.d.ts +0 -111
  201. package/lib/typescript/tracker.d.ts.map +0 -1
  202. package/lib/typescript/types.d.ts +0 -981
  203. package/lib/typescript/types.d.ts.map +0 -1
  204. package/lib/typescript/utils.d.ts +0 -35
  205. package/lib/typescript/utils.d.ts.map +0 -1
  206. package/lib/typescript/webViewInterface.d.ts +0 -15
  207. package/lib/typescript/webViewInterface.d.ts.map +0 -1
  208. package/scripts/bootstrap.js +0 -29
  209. package/snowplow-react-native-tracker.podspec +0 -42
  210. package/src/__mocks__/react-native.js +0 -7
  211. package/src/__tests__/api.test.ts +0 -21
  212. package/src/__tests__/configurations.test.ts +0 -608
  213. package/src/__tests__/events.test.ts +0 -736
  214. package/src/__tests__/index.test.ts +0 -14
  215. package/src/__tests__/jsCore.test.ts +0 -199
  216. package/src/__tests__/utils.test.ts +0 -10
  217. package/src/api.ts +0 -556
  218. package/src/configurations.ts +0 -325
  219. package/src/constants.ts +0 -97
  220. package/src/events.ts +0 -355
  221. package/src/index.ts +0 -184
  222. package/src/jsCore.ts +0 -603
  223. package/src/native.ts +0 -21
  224. package/src/subject.ts +0 -302
  225. package/src/tracker.ts +0 -377
  226. package/src/types.ts +0 -1162
  227. package/src/utils.ts +0 -65
  228. package/src/webViewInterface.ts +0 -92
  229. package/tsconfig.build.json +0 -5
  230. package/tsconfig.json +0 -28
  231. package/turbo.json +0 -34
  232. package/yarn.lock +0 -9398
package/src/types.ts DELETED
@@ -1,1162 +0,0 @@
1
- /**
2
- * HttpMethod type
3
- */
4
- export type HttpMethod = 'post' | 'get';
5
-
6
- /**
7
- * DevicePlatform type
8
- */
9
- export type DevicePlatform =
10
- | 'web'
11
- | 'mob'
12
- | 'pc'
13
- | 'srv'
14
- | 'app'
15
- | 'tv'
16
- | 'cnsl'
17
- | 'iot';
18
-
19
- /**
20
- * LogLevel type
21
- */
22
- export type LogLevel = 'off' | 'error' | 'debug' | 'verbose';
23
-
24
- /**
25
- * BasisForProsessing
26
- */
27
- export type Basis =
28
- | 'consent'
29
- | 'contract'
30
- | 'legal_obligation'
31
- | 'legitimate_interests'
32
- | 'public_task'
33
- | 'vital_interests';
34
-
35
- /**
36
- * BufferOption
37
- */
38
- export type BufferOption = 'single' | 'small' | 'large';
39
-
40
- /**
41
- * Trigger for MessageNotification event
42
- */
43
- export type Trigger =
44
- | 'push'
45
- | 'location'
46
- | 'calendar'
47
- | 'timeInterval'
48
- | 'other';
49
-
50
- /**
51
- * ScreenSize
52
- */
53
- export type ScreenSize = [number, number];
54
-
55
- /**
56
- * SelfDescribing type
57
- */
58
- export type SelfDescribing<
59
- T extends Record<string, unknown> = Record<string, unknown>
60
- > = {
61
- /**
62
- * Schema
63
- */
64
- schema: string;
65
- /**
66
- * Data
67
- */
68
- data: T;
69
- };
70
-
71
- /**
72
- * EventContext type
73
- */
74
- export type EventContext = SelfDescribing;
75
-
76
- /**
77
- * NetworkConfiguration
78
- */
79
- export interface NetworkConfiguration {
80
- /**
81
- * The collector endpoint
82
- * - if the protocol is not included it defaults to https
83
- */
84
- endpoint: string;
85
-
86
- /**
87
- * The Http Method to use when sending events to the collector
88
- * @defaultValue 'post'
89
- */
90
- method?: HttpMethod;
91
-
92
- /**
93
- * A custom path which will be added to the endpoint URL to specify the
94
- * complete URL of the collector when paired with the POST method.
95
- *
96
- * @defaultValue `com.snowplowanalytics.snowplow/tp2`.
97
- */
98
- customPostPath?: string;
99
-
100
- /**
101
- * Custom headers for HTTP requests to the Collector.
102
- */
103
- requestHeaders?: Record<string, string>;
104
- }
105
-
106
- /**
107
- * TrackerConfiguration
108
- */
109
- export interface TrackerConfiguration {
110
- /**
111
- * Identifier of the app.
112
- */
113
- appId?: string;
114
- /**
115
- * The device platform the tracker runs on.
116
- * @defaultValue 'mob'
117
- */
118
- devicePlatform?: DevicePlatform;
119
- /**
120
- * Whether payload JSON data should be base64 encoded.
121
- * @defaultValue true
122
- */
123
- base64Encoding?: boolean;
124
- /**
125
- * The log level of tracker logs.
126
- * @defaultValue 'off'
127
- */
128
- logLevel?: LogLevel;
129
- /**
130
- * Whether application context is attached to tracked events.
131
- * @defaultValue true
132
- */
133
- applicationContext?: boolean;
134
- /**
135
- * Whether platform context is attached to tracked events.
136
- * @defaultValue true
137
- */
138
- platformContext?: boolean;
139
- /**
140
- * Whether geo-location context is attached to tracked events.
141
- * @defaultValue false
142
- */
143
- geoLocationContext?: boolean;
144
- /**
145
- * Whether session context is attached to tracked events.
146
- * @defaultValue true
147
- */
148
- sessionContext?: boolean;
149
- /**
150
- * Whether to attach a Deep Link entity to the first ScreenView tracked in the tracker after DeepLinkReceived event.
151
- * @defaultValue true
152
- */
153
- deepLinkContext?: boolean;
154
- /**
155
- * Whether screen context is attached to tracked events.
156
- * @defaultValue true
157
- */
158
- screenContext?: boolean;
159
- /**
160
- * Whether to enable automatic tracking of ScreenView events from the native side.
161
- * Only tracking UIKit views on iOS and Activity on Android are supported.
162
- * For tracking React Native views, see the tracker docs for manual and auto-tracking options.
163
- * @defaultValue false
164
- */
165
- screenViewAutotracking?: boolean;
166
- /**
167
- * Whether to enable tracking of the screen end event and the screen summary context entity.
168
- * Make sure that you have lifecycle autotracking enabled for screen summary to have complete information.
169
- * @defaultValue true
170
- */
171
- screenEngagementAutotracking?: boolean;
172
- /**
173
- * Whether enable automatic tracking of background and foreground transitions.
174
- * @defaultValue true
175
- */
176
- lifecycleAutotracking?: boolean;
177
- /**
178
- * Whether enable automatic tracking of install event.
179
- * @defaultValue true
180
- */
181
- installAutotracking?: boolean;
182
- /**
183
- * Whether enable crash reporting.
184
- * @defaultValue true
185
- */
186
- exceptionAutotracking?: boolean;
187
- /**
188
- * Whether enable diagnostic reporting.
189
- * @defaultValue false
190
- */
191
- diagnosticAutotracking?: boolean;
192
- /**
193
- * Whether to anonymise client-side user identifiers in session and platform context entities
194
- * @defaultValue false
195
- */
196
- userAnonymisation?: boolean;
197
- }
198
-
199
- /**
200
- * SessionConfiguration
201
- */
202
- export interface SessionConfiguration {
203
- /**
204
- * The amount of time in seconds before the session id is updated while the app is in the foreground
205
- * @defaultValue 1800
206
- */
207
- foregroundTimeout: number;
208
- /**
209
- * The amount of time in seconds before the session id is updated while the app is in the background
210
- * @defaultValue 1800
211
- */
212
- backgroundTimeout: number;
213
- }
214
-
215
- /**
216
- * EmitterConfiguration
217
- */
218
- export interface EmitterConfiguration {
219
- /**
220
- * The buffer option for post requests.
221
- * @defaultValue 'single'
222
- */
223
- bufferOption?: BufferOption;
224
-
225
- /**
226
- * Maximum number of events collected from the EventStore to be sent in a request.
227
- * @defaultValue 150
228
- */
229
- emitRange?: number;
230
-
231
- /**
232
- *Maximum number of threads working in parallel in the tracker to send requests.
233
- * @defaultValue 15
234
- */
235
- threadPoolSize?: number;
236
-
237
- /**
238
- * Maximum amount of bytes allowed to be sent in a payload in a POST request.
239
- * @defaultValue 40000
240
- */
241
- byteLimitPost?: number;
242
-
243
- /**
244
- * Maximum amount of bytes allowed to be sent in a payload in a GET request.
245
- * @defaultValue 40000
246
- */
247
- byteLimitGet?: number;
248
-
249
- /**
250
- * Whether to anonymise server-side user identifiers including the `network_userid` and `user_ipaddress`
251
- * @defaultValue false
252
- */
253
- serverAnonymisation?: boolean;
254
- }
255
-
256
- /**
257
- * SubjectConfiguration
258
- */
259
- export interface SubjectConfiguration {
260
- [index: string]: unknown;
261
- /**
262
- * user id
263
- */
264
- userId?: string | null;
265
- /**
266
- * network user id (UUIDv4)
267
- */
268
- networkUserId?: string | null;
269
- /**
270
- * domain user id
271
- */
272
- domainUserId?: string | null;
273
- /**
274
- * The custom user-agent. It overrides the user-agent used by default.
275
- */
276
- useragent?: string | null;
277
- /**
278
- * IP address
279
- */
280
- ipAddress?: string | null;
281
- /**
282
- * The timezone label
283
- */
284
- timezone?: string | null;
285
- /**
286
- * The language set in the device
287
- */
288
- language?: string | null;
289
- /**
290
- * The screen resolution
291
- */
292
- screenResolution?: ScreenSize | null;
293
- /**
294
- * The screen viewport size
295
- */
296
- screenViewport?: ScreenSize | null;
297
- /**
298
- * color depth (integer)
299
- */
300
- colorDepth?: number | null;
301
- }
302
-
303
- /**
304
- * GdprConfiguration
305
- */
306
- export interface GdprConfiguration {
307
- /**
308
- * Basis for processing
309
- */
310
- basisForProcessing: Basis;
311
- /**
312
- * ID of a GDPR basis document.
313
- */
314
- documentId: string;
315
- /**
316
- * Version of the document.
317
- */
318
- documentVersion: string;
319
- /**
320
- * Description of the document.
321
- */
322
- documentDescription: string;
323
- }
324
-
325
- /**
326
- * Global Context
327
- */
328
- export interface GlobalContext {
329
- /**
330
- * tag
331
- */
332
- tag: string;
333
- /**
334
- * contexts
335
- */
336
- globalContexts: SelfDescribing[];
337
- }
338
-
339
- /**
340
- * Global Contexts configuration
341
- */
342
- export type GCConfiguration = GlobalContext[];
343
-
344
- /**
345
- * The TrackerControllerConfiguration
346
- */
347
- export interface TrackerControllerConfiguration {
348
- trackerConfig?: TrackerConfiguration;
349
- sessionConfig?: SessionConfiguration;
350
- emitterConfig?: EmitterConfiguration;
351
- subjectConfig?: SubjectConfiguration;
352
- gdprConfig?: GdprConfiguration;
353
- gcConfig?: GCConfiguration;
354
- }
355
-
356
- /**
357
- * The TrackerConfiguration
358
- */
359
- export interface InitTrackerConfiguration
360
- extends TrackerControllerConfiguration {
361
- namespace: string;
362
- networkConfig: NetworkConfiguration;
363
- }
364
-
365
- /**
366
- * ScreenView event properties
367
- * schema: iglu:com.snowplowanalytics.mobile/screen_view/jsonschema/1-0-0
368
- */
369
- export type ScreenViewProps = {
370
- /**
371
- * The name of the screen viewed
372
- */
373
- name: string;
374
- /**
375
- * The id(UUID) of screen that was viewed
376
- */
377
- id?: string;
378
- /**
379
- * The type of screen that was viewed
380
- */
381
- type?: string;
382
- /**
383
- * The name of the previous screen that was viewed
384
- */
385
- previousName?: string;
386
- /**
387
- * The id(UUID) of the previous screen that was viewed
388
- */
389
- previousId?: string;
390
- /**
391
- * The type of the previous screen that was viewed
392
- */
393
- previousType?: string;
394
- /**
395
- * The type of transition that led to the screen being viewed
396
- */
397
- transitionType?: string;
398
- };
399
-
400
- /**
401
- * Event tracked when a scroll view's scroll position changes.
402
- * If screen engagement tracking is enabled, the scroll changed events will be aggregated into a `screen_summary` entity.
403
- *
404
- * Schema: `iglu:com.snowplowanalytics.mobile/scroll_changed/jsonschema/1-0-0`
405
- */
406
- export type ScrollChangedProps = {
407
- /**
408
- * Vertical scroll offset in pixels
409
- */
410
- yOffset?: number;
411
- /**
412
- * Horizontal scroll offset in pixels.
413
- */
414
- xOffset?: number;
415
- /**
416
- * The height of the scroll view in pixels
417
- */
418
- viewHeight?: number;
419
- /**
420
- * The width of the scroll view in pixels
421
- */
422
- viewWidth?: number;
423
- /**
424
- * The height of the content in the scroll view in pixels
425
- */
426
- contentHeight?: number;
427
- /**
428
- * The width of the content in the scroll view in pixels
429
- */
430
- contentWidth?: number;
431
- };
432
-
433
- /**
434
- * Event tracking the view of an item in a list.
435
- * If screen engagement tracking is enabled, the list item view events will be aggregated into a `screen_summary` entity.
436
- *
437
- * Schema: `iglu:com.snowplowanalytics.mobile/list_item_view/jsonschema/1-0-0`
438
- */
439
- export type ListItemViewProps = {
440
- /**
441
- * Index of the item in the list
442
- */
443
- index: number;
444
- /**
445
- * Total number of items in the list
446
- */
447
- itemsCount?: number;
448
- };
449
-
450
- /**
451
- * Structured event properties
452
- */
453
- export type StructuredProps = {
454
- /**
455
- * The category of the event
456
- */
457
- category: string;
458
- /**
459
- * The action the event represents
460
- */
461
- action: string;
462
- /**
463
- * The label the action refers to
464
- */
465
- label?: string;
466
- /**
467
- * The property associated with the user action
468
- */
469
- property?: string;
470
- /**
471
- * The value associated with the user action
472
- */
473
- value?: number;
474
- };
475
-
476
- /**
477
- * PageView event properties
478
- */
479
- export type PageViewProps = {
480
- /**
481
- * The page URL
482
- */
483
- pageUrl: string;
484
- /**
485
- * The page title
486
- */
487
- pageTitle?: string;
488
- /**
489
- * The referrer URL
490
- */
491
- referrer?: string;
492
- };
493
-
494
- /**
495
- * Timing event properties
496
- */
497
- export type TimingProps = {
498
- /**
499
- * The timing category
500
- */
501
- category: string;
502
- /**
503
- * The timing variable
504
- */
505
- variable: string;
506
- /**
507
- * The time
508
- */
509
- timing: number;
510
- /**
511
- * The timing label
512
- */
513
- label?: string;
514
- };
515
-
516
- /**
517
- * ConsentDocument properties
518
- */
519
- export interface ConsentDocument {
520
- /**
521
- * The consent document id
522
- */
523
- documentId: string;
524
- /**
525
- * The consent document version
526
- */
527
- version: string;
528
- /**
529
- * The consent document name
530
- */
531
- name?: string;
532
- /**
533
- * The consent document description
534
- */
535
- documentDescription?: string;
536
- }
537
-
538
- /**
539
- * ConsentGranted event properties
540
- */
541
- export interface ConsentGrantedProps extends ConsentDocument {
542
- /**
543
- * The expiry (date-time string, e.g.: '2022-01-01T00:00:00Z')
544
- */
545
- expiry: string;
546
- }
547
-
548
- /**
549
- * ConsentWithdrawn event properties
550
- */
551
- export interface ConsentWithdrawnProps extends ConsentDocument {
552
- /**
553
- * Whether user opts out of all data collection
554
- */
555
- all: boolean;
556
- }
557
-
558
- /**
559
- * EcommerceItem
560
- */
561
- export type EcommerceItem = {
562
- /*
563
- * The item sku
564
- */
565
- sku: string;
566
- /*
567
- * The item price
568
- */
569
- price: number;
570
- /*
571
- * The item quantity
572
- */
573
- quantity: number;
574
- /*
575
- * The item name
576
- */
577
- name?: string;
578
- /*
579
- * The item category
580
- */
581
- category?: string;
582
- /*
583
- * The item quantity
584
- */
585
- currency?: string;
586
- };
587
-
588
- /**
589
- * EcommerceTransaction event properties
590
- */
591
- export type EcommerceTransactionProps = {
592
- /*
593
- * The order ID of the transaction
594
- */
595
- orderId: string;
596
- /*
597
- * The total value of the transaction
598
- */
599
- totalValue: number;
600
- /*
601
- * The items(array) purchased in the transaction
602
- */
603
- items: EcommerceItem[];
604
- /*
605
- * The transaction affiliation
606
- */
607
- affiliation?: string;
608
- /*
609
- * The tax value of the transaction
610
- */
611
- taxValue?: number;
612
- /*
613
- * The shipping value of the transaction
614
- */
615
- shipping?: number;
616
- /*
617
- * The city of the transaction
618
- */
619
- city?: string;
620
- /*
621
- * The state(US) of the transaction
622
- */
623
- state?: string;
624
- /*
625
- * The country of the transaction
626
- */
627
- country?: string;
628
- /*
629
- * The currency of the transaction
630
- */
631
- currency?: string;
632
- };
633
-
634
- /**
635
- * DeepLinkReceived event properties
636
- * schema: iglu:com.snowplowanalytics.mobile/deep_link_received/jsonschema/1-0-0
637
- */
638
- export type DeepLinkReceivedProps = {
639
- /**
640
- * URL in the received deep-link.
641
- */
642
- url: string;
643
- /**
644
- * Referrer URL, source of this deep-link.
645
- */
646
- referrer?: string;
647
- };
648
-
649
- /**
650
- * Attachment object that identify an attachment in the MessageNotification.
651
- */
652
- export type MessageNotificationAttachmentProps = {
653
- identifier: string;
654
- type: string;
655
- url: string;
656
- };
657
-
658
- /**
659
- * MessageNotification event properties
660
- * schema: iglu:com.snowplowanalytics.mobile/message_notification/jsonschema/1-0-0
661
- */
662
- export type MessageNotificationProps = {
663
- /**
664
- * The action associated with the notification.
665
- */
666
- action?: string;
667
- /*
668
- * Attachments added to the notification (they can be part of the data object).
669
- */
670
- attachments?: MessageNotificationAttachmentProps[];
671
- /**
672
- * The notification's body.
673
- */
674
- body: string;
675
- /*
676
- * Variable string values to be used in place of the format specifiers in bodyLocArgs to use to localize the body text to the user's current localization.
677
- */
678
- bodyLocArgs?: string[];
679
- /**
680
- * The key to the body string in the app's string resources to use to localize the body text to the user's current localization.
681
- */
682
- bodyLocKey?: string;
683
- /**
684
- * The category associated to the notification.
685
- */
686
- category?: string;
687
- /**
688
- * The application is notified of the delivery of the notification if it's in the foreground or background, the app will be woken up (iOS only).
689
- */
690
- contentAvailable?: boolean;
691
- /**
692
- * The group which this notification is part of.
693
- */
694
- group?: string;
695
- /**
696
- * The icon associated to the notification (Android only).
697
- */
698
- icon?: string;
699
- /**
700
- * The number of items this notification represent.
701
- */
702
- notificationCount?: number;
703
- /**
704
- * The time when the event of the notification occurred.
705
- */
706
- notificationTimestamp?: string;
707
- /**
708
- * The sound played when the device receives the notification.
709
- */
710
- sound?: string;
711
- /**
712
- * The notification's subtitle. (iOS only)
713
- */
714
- subtitle?: string;
715
- /**
716
- * An identifier similar to 'group' but usable for different purposes (Android only).
717
- */
718
- tag?: string;
719
- /**
720
- * An identifier similar to 'group' but usable for different purposes (iOS only).
721
- */
722
- threadIdentifier?: string;
723
- /**
724
- * The notification's title.
725
- */
726
- title: string;
727
- /**
728
- * Variable string values to be used in place of the format specifiers in titleLocArgs to use to localize the title text to the user's current localization.
729
- */
730
- titleLocArgs?: string[];
731
- /**
732
- * The key to the title string in the app's string resources to use to localize the title text to the user's current localization.
733
- */
734
- titleLocKey?: string;
735
- /**
736
- * The trigger that raised the notification message. Must be one of: push, location, calendar, timeInterval, other
737
- */
738
- trigger: Trigger;
739
- };
740
-
741
- /**
742
- * The ReactNativeTracker type
743
- */
744
- export type ReactNativeTracker = {
745
- /**
746
- * Tracks a self-describing event
747
- *
748
- * @param argmap - The self-describing event properties
749
- * @param contexts - The array of event contexts
750
- * @typeParam TData - The type of the data object within the SelfDescribing object
751
- */
752
- readonly trackSelfDescribingEvent: <
753
- TData extends Record<string, unknown> = Record<string, unknown>
754
- >(
755
- argmap: SelfDescribing<TData>,
756
- contexts?: EventContext[]
757
- ) => Promise<void>;
758
-
759
- /**
760
- * Tracks a screen-view event
761
- *
762
- * @param argmap - The screen-view event's properties
763
- * @param contexts - The array of event contexts
764
- */
765
- readonly trackScreenViewEvent: (
766
- argmap: ScreenViewProps,
767
- contexts?: EventContext[]
768
- ) => Promise<void>;
769
-
770
- /**
771
- * Tracks a scroll changed event
772
- *
773
- * @param argmap - The scroll changed event's properties
774
- * @param contexts - The array of event contexts
775
- */
776
- readonly trackScrollChangedEvent: (
777
- argmap: ScrollChangedProps,
778
- contexts?: EventContext[]
779
- ) => Promise<void>;
780
-
781
- /**
782
- * Tracks a list item view event
783
- *
784
- * @param argmap - The list item view event's properties
785
- * @param contexts - The array of event contexts
786
- */
787
- readonly trackListItemViewEvent: (
788
- argmap: ListItemViewProps,
789
- contexts?: EventContext[]
790
- ) => Promise<void>;
791
-
792
- /**
793
- * Tracks a structured event
794
- *
795
- * @param argmap - The structured event properties
796
- * @param contexts - The array of event contexts
797
- */
798
- readonly trackStructuredEvent: (
799
- argmap: StructuredProps,
800
- contexts?: EventContext[]
801
- ) => Promise<void>;
802
-
803
- /**
804
- * Tracks a page-view event
805
- *
806
- * @param argmap - The page-view event properties
807
- * @param contexts - The array of event contexts
808
- */
809
- readonly trackPageViewEvent: (
810
- argmap: PageViewProps,
811
- contexts?: EventContext[]
812
- ) => Promise<void>;
813
-
814
- /**
815
- * Tracks a timing event
816
- *
817
- * @param argmap - The timing event properties
818
- * @param contexts - The array of event contexts
819
- */
820
- readonly trackTimingEvent: (
821
- argmap: TimingProps,
822
- contexts?: EventContext[]
823
- ) => Promise<void>;
824
-
825
- /**
826
- * Tracks a consent-granted event
827
- *
828
- * @param argmap - The consent-granted event properties
829
- * @param contexts - The array of event contexts
830
- */
831
- readonly trackConsentGrantedEvent: (
832
- argmap: ConsentGrantedProps,
833
- contexts?: EventContext[]
834
- ) => Promise<void>;
835
-
836
- /**
837
- * Tracks a consent-withdrawn event
838
- *
839
- * @param argmap - The consent-withdrawn event properties
840
- * @param contexts - The array of event contexts
841
- */
842
- readonly trackConsentWithdrawnEvent: (
843
- argmap: ConsentWithdrawnProps,
844
- contexts?: EventContext[]
845
- ) => Promise<void>;
846
-
847
- /**
848
- * Tracks an ecommerce-transaction event
849
- *
850
- * @param argmap - The ecommerce-transaction event properties
851
- * @param contexts - The array of event contexts
852
- */
853
- readonly trackEcommerceTransactionEvent: (
854
- argmap: EcommerceTransactionProps,
855
- contexts?: EventContext[]
856
- ) => Promise<void>;
857
-
858
- /**
859
- * Tracks a deep link received event
860
- *
861
- * @param argmap - The deep link received event properties
862
- * @param contexts - The array of event contexts
863
- */
864
- readonly trackDeepLinkReceivedEvent: (
865
- argmap: DeepLinkReceivedProps,
866
- contexts?: EventContext[]
867
- ) => Promise<void>;
868
-
869
- /**
870
- * Tracks a message notification event
871
- *
872
- * @param argmap - The message notification event properties
873
- * @param contexts - The array of event contexts
874
- */
875
- readonly trackMessageNotificationEvent: (
876
- argmap: MessageNotificationProps,
877
- contexts?: EventContext[]
878
- ) => Promise<void>;
879
-
880
- /**
881
- * Removes global contexts
882
- *
883
- * @param tag - The tag of the global contexts to remove
884
- */
885
- readonly removeGlobalContexts: (tag: string) => Promise<void>;
886
-
887
- /**
888
- * Adds global contexts
889
- *
890
- * @param gc - The global context to add
891
- */
892
- readonly addGlobalContexts: (gc: GlobalContext) => Promise<void>;
893
-
894
- /**
895
- * Sets the userId of the tracker subject
896
- *
897
- * @param newUid - The new userId
898
- */
899
- readonly setUserId: (newUid: string | null) => Promise<void>;
900
-
901
- /**
902
- * Sets the networkUserId of the tracker subject
903
- *
904
- * @param newNuid - The new networkUserId
905
- */
906
- readonly setNetworkUserId: (newNuid: string | null) => Promise<void>;
907
-
908
- /**
909
- * Sets the domainUserId of the tracker subject
910
- *
911
- * @param newDuid - The new domainUserId
912
- */
913
- readonly setDomainUserId: (newDuid: string | null) => Promise<void>;
914
-
915
- /**
916
- * Sets the ipAddress of the tracker subject
917
- *
918
- * @param newIp - The new ipAddress
919
- */
920
- readonly setIpAddress: (newIp: string | null) => Promise<void>;
921
-
922
- /**
923
- * Sets the useragent of the tracker subject
924
- *
925
- * @param newUagent - The new useragent
926
- */
927
- readonly setUseragent: (newUagent: string | null) => Promise<void>;
928
-
929
- /**
930
- * Sets the timezone of the tracker subject
931
- *
932
- * @param newTz - The new timezone
933
- */
934
- readonly setTimezone: (newTz: string | null) => Promise<void>;
935
-
936
- /**
937
- * Sets the language of the tracker subject
938
- *
939
- * @param newLang - The new language
940
- */
941
- readonly setLanguage: (newLang: string | null) => Promise<void>;
942
-
943
- /**
944
- * Sets the screenResolution of the tracker subject
945
- *
946
- * @param newRes - The new screenResolution
947
- */
948
- readonly setScreenResolution: (newRes: ScreenSize | null) => Promise<void>;
949
-
950
- /**
951
- * Sets the screenViewport of the tracker subject
952
- *
953
- * @param newView - The new screenViewport
954
- */
955
- readonly setScreenViewport: (newView: ScreenSize | null) => Promise<void>;
956
-
957
- /**
958
- * Sets the colorDepth of the tracker subject
959
- *
960
- * @param newColorD - The new colorDepth
961
- */
962
- readonly setColorDepth: (newLang: number | null) => Promise<void>;
963
-
964
- /**
965
- * Sets subject data
966
- *
967
- * @param config - The new subject data
968
- */
969
- readonly setSubjectData: (config: SubjectConfiguration) => Promise<void>;
970
-
971
- /**
972
- * Gets the dentifier for the user of the session
973
- *
974
- * @returns {Promise<string | undefined>}
975
- */
976
- readonly getSessionUserId: () => Promise<string | undefined>;
977
-
978
- /**
979
- * Gets the identifier for the session
980
- *
981
- * @returns {Promise<string | undefined>}
982
- */
983
- readonly getSessionId: () => Promise<string | undefined>;
984
-
985
- /**
986
- * Gets the index of the current session for this user
987
- *
988
- * @returns {Promise<number | undefined>}
989
- */
990
- readonly getSessionIndex: () => Promise<number | undefined>;
991
-
992
- /**
993
- * Gets whether the app is currently in background state
994
- *
995
- * @returns {Promise<boolean | undefined>}
996
- */
997
- readonly getIsInBackground: () => Promise<boolean | undefined>;
998
-
999
- /**
1000
- * Gets the number of background transitions in the current session
1001
- *
1002
- * @returns {Promise<number | undefined>}
1003
- */
1004
- readonly getBackgroundIndex: () => Promise<number | undefined>;
1005
-
1006
- /**
1007
- * Gets the number of foreground transitions in the current session.
1008
- *
1009
- * @returns {Promise<number | undefined>}
1010
- */
1011
- readonly getForegroundIndex: () => Promise<number | undefined>;
1012
- };
1013
-
1014
- /**
1015
- * Internal event type for page views tracked using the WebView tracker.
1016
- */
1017
- export interface WebViewPageViewEvent {
1018
- title?: string | null;
1019
- url?: string;
1020
- referrer?: string;
1021
- }
1022
-
1023
- /**
1024
- * Internal type exchanged in messages received from the WebView tracker in Web views through the web view callback.
1025
- */
1026
- export type WebViewMessage = {
1027
- command:
1028
- | 'trackSelfDescribingEvent'
1029
- | 'trackStructEvent'
1030
- | 'trackPageView'
1031
- | 'trackScreenView';
1032
- event:
1033
- | StructuredProps
1034
- | SelfDescribing
1035
- | ScreenViewProps
1036
- | WebViewPageViewEvent;
1037
- context?: Array<SelfDescribing> | null;
1038
- trackers?: Array<string>;
1039
- };
1040
-
1041
- /**
1042
- * Internal type for representing the interface to the native trackers.
1043
- */
1044
- export interface Native {
1045
- createTracker: (configuration: InitTrackerConfiguration) => Promise<void>;
1046
- removeTracker: (details: { tracker: string }) => Promise<boolean>;
1047
- removeAllTrackers: () => Promise<boolean>;
1048
- trackSelfDescribingEvent: (details: {
1049
- tracker: string | null;
1050
- eventData: SelfDescribing;
1051
- contexts: EventContext[];
1052
- }) => Promise<void>;
1053
- trackStructuredEvent: (details: {
1054
- tracker: string | null;
1055
- eventData: StructuredProps;
1056
- contexts: EventContext[];
1057
- }) => Promise<void>;
1058
- trackScreenViewEvent: (details: {
1059
- tracker: string | null;
1060
- eventData: ScreenViewProps;
1061
- contexts: EventContext[];
1062
- }) => Promise<void>;
1063
- trackScrollChangedEvent: (details: {
1064
- tracker: string | null;
1065
- eventData: ScrollChangedProps;
1066
- contexts: EventContext[];
1067
- }) => Promise<void>;
1068
- trackListItemViewEvent: (details: {
1069
- tracker: string | null;
1070
- eventData: ListItemViewProps;
1071
- contexts: EventContext[];
1072
- }) => Promise<void>;
1073
- trackPageViewEvent: (details: {
1074
- tracker: string | null;
1075
- eventData: PageViewProps;
1076
- contexts: EventContext[];
1077
- }) => Promise<void>;
1078
- trackTimingEvent: (details: {
1079
- tracker: string | null;
1080
- eventData: TimingProps;
1081
- contexts: EventContext[];
1082
- }) => Promise<void>;
1083
- trackConsentGrantedEvent: (details: {
1084
- tracker: string | null;
1085
- eventData: ConsentGrantedProps;
1086
- contexts: EventContext[];
1087
- }) => Promise<void>;
1088
- trackConsentWithdrawnEvent: (details: {
1089
- tracker: string | null;
1090
- eventData: ConsentWithdrawnProps;
1091
- contexts: EventContext[];
1092
- }) => Promise<void>;
1093
- trackEcommerceTransactionEvent: (details: {
1094
- tracker: string | null;
1095
- eventData: EcommerceTransactionProps;
1096
- contexts: EventContext[];
1097
- }) => Promise<void>;
1098
- trackDeepLinkReceivedEvent: (details: {
1099
- tracker: string | null;
1100
- eventData: DeepLinkReceivedProps;
1101
- contexts: EventContext[];
1102
- }) => Promise<void>;
1103
- trackMessageNotificationEvent: (details: {
1104
- tracker: string | null;
1105
- eventData: MessageNotificationProps;
1106
- contexts: EventContext[];
1107
- }) => Promise<void>;
1108
- removeGlobalContexts: (details: {
1109
- tracker: string;
1110
- removeTag: string;
1111
- }) => Promise<void>;
1112
- addGlobalContexts: (details: {
1113
- tracker: string;
1114
- addGlobalContext: GlobalContext;
1115
- }) => Promise<void>;
1116
- setUserId: (details: {
1117
- tracker: string;
1118
- userId: string | null;
1119
- }) => Promise<void>;
1120
- setNetworkUserId: (details: {
1121
- tracker: string;
1122
- networkUserId: string | null;
1123
- }) => Promise<void>;
1124
- setDomainUserId: (details: {
1125
- tracker: string;
1126
- domainUserId: string | null;
1127
- }) => Promise<void>;
1128
- setIpAddress: (details: {
1129
- tracker: string;
1130
- ipAddress: string | null;
1131
- }) => Promise<void>;
1132
- setUseragent: (details: {
1133
- tracker: string;
1134
- useragent: string | null;
1135
- }) => Promise<void>;
1136
- setTimezone: (details: {
1137
- tracker: string;
1138
- timezone: string | null;
1139
- }) => Promise<void>;
1140
- setLanguage: (details: {
1141
- tracker: string;
1142
- language: string | null;
1143
- }) => Promise<void>;
1144
- setScreenResolution: (details: {
1145
- tracker: string;
1146
- screenResolution: ScreenSize | null;
1147
- }) => Promise<void>;
1148
- setScreenViewport: (details: {
1149
- tracker: string;
1150
- screenViewport: ScreenSize | null;
1151
- }) => Promise<void>;
1152
- setColorDepth: (details: {
1153
- tracker: string;
1154
- colorDepth: number | null;
1155
- }) => Promise<void>;
1156
- getSessionUserId: (details: { tracker: string }) => Promise<string>;
1157
- getSessionId: (details: { tracker: string }) => Promise<string>;
1158
- getSessionIndex: (details: { tracker: string }) => Promise<number>;
1159
- getIsInBackground: (details: { tracker: string }) => Promise<boolean>;
1160
- getBackgroundIndex: (details: { tracker: string }) => Promise<number>;
1161
- getForegroundIndex: (details: { tracker: string }) => Promise<number>;
1162
- }