mixpanel-browser 2.74.0 → 2.76.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 (61) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/.github/workflows/integration-tests.yml +2 -2
  3. package/.github/workflows/unit-tests.yml +3 -3
  4. package/CHANGELOG.md +15 -0
  5. package/README.md +2 -2
  6. package/build.sh +10 -8
  7. package/dist/async-modules/mixpanel-recorder-bIS4LMGd.js +23595 -0
  8. package/dist/async-modules/mixpanel-recorder-hFoTniVR.min.js +2 -0
  9. package/dist/async-modules/mixpanel-recorder-hFoTniVR.min.js.map +1 -0
  10. package/dist/async-modules/mixpanel-targeting-BcAPS-Mz.js +2520 -0
  11. package/dist/async-modules/mixpanel-targeting-VOeN7RWY.min.js +2 -0
  12. package/dist/async-modules/mixpanel-targeting-VOeN7RWY.min.js.map +1 -0
  13. package/dist/mixpanel-core.cjs.d.ts +68 -0
  14. package/dist/mixpanel-core.cjs.js +802 -337
  15. package/dist/mixpanel-recorder.js +828 -40
  16. package/dist/mixpanel-recorder.min.js +1 -1
  17. package/dist/mixpanel-recorder.min.js.map +1 -1
  18. package/dist/mixpanel-targeting.js +2520 -0
  19. package/dist/mixpanel-targeting.min.js +2 -0
  20. package/dist/mixpanel-targeting.min.js.map +1 -0
  21. package/dist/mixpanel-with-async-modules.cjs.d.ts +590 -0
  22. package/dist/mixpanel-with-async-modules.cjs.js +9867 -0
  23. package/dist/mixpanel-with-async-recorder.cjs.d.ts +68 -0
  24. package/dist/mixpanel-with-async-recorder.cjs.js +802 -337
  25. package/dist/mixpanel-with-recorder.d.ts +68 -0
  26. package/dist/mixpanel-with-recorder.js +1591 -343
  27. package/dist/mixpanel-with-recorder.min.d.ts +68 -0
  28. package/dist/mixpanel-with-recorder.min.js +1 -1
  29. package/dist/mixpanel.amd.d.ts +68 -0
  30. package/dist/mixpanel.amd.js +2124 -345
  31. package/dist/mixpanel.cjs.d.ts +68 -0
  32. package/dist/mixpanel.cjs.js +2124 -345
  33. package/dist/mixpanel.globals.js +802 -337
  34. package/dist/mixpanel.min.js +185 -175
  35. package/dist/mixpanel.module.d.ts +68 -0
  36. package/dist/mixpanel.module.js +2124 -345
  37. package/dist/mixpanel.umd.d.ts +68 -0
  38. package/dist/mixpanel.umd.js +2124 -345
  39. package/dist/rrweb-bundled.js +119 -5
  40. package/dist/rrweb-compiled.js +116 -5
  41. package/logo.svg +5 -0
  42. package/package.json +5 -3
  43. package/rollup.config.mjs +189 -40
  44. package/src/autocapture/index.js +10 -27
  45. package/src/config.js +9 -3
  46. package/src/flags/index.js +269 -9
  47. package/src/index.d.ts +68 -0
  48. package/src/loaders/loader-module.js +1 -0
  49. package/src/mixpanel-core.js +83 -109
  50. package/src/recorder/index.js +2 -1
  51. package/src/recorder/recorder.js +5 -1
  52. package/src/recorder/rrweb-network-plugin.js +649 -0
  53. package/src/recorder/session-recording.js +31 -11
  54. package/src/recorder-manager.js +216 -0
  55. package/src/request-batcher.js +1 -1
  56. package/src/targeting/event-matcher.js +42 -0
  57. package/src/targeting/index.js +11 -0
  58. package/src/targeting/loader.js +36 -0
  59. package/src/utils.js +14 -9
  60. package/testServer.js +55 -0
  61. /package/src/loaders/{loader-module-with-async-recorder.js → loader-module-with-async-modules.js} +0 -0
@@ -0,0 +1,590 @@
1
+ import type { RulesLogic } from 'json-logic-js';
2
+
3
+ export type Persistence = "cookie" | "localStorage";
4
+
5
+ export type ApiPayloadFormat = "base64" | "json";
6
+
7
+ export type PushItem = Array<string | Dict | ((this: Mixpanel) => void)>;
8
+
9
+ export type Query = string | Element | Element[];
10
+
11
+ export type RemoteSettingType = "disabled" | "fallback" | "strict";
12
+
13
+
14
+ export interface EventTriggerProps {
15
+ percentage: number;
16
+ property_filters?: RulesLogic;
17
+ }
18
+
19
+ export interface RecordingEventTriggers {
20
+ [eventName: string]: EventTriggerProps;
21
+ }
22
+
23
+ export interface Dict {
24
+ [key: string]: any;
25
+ }
26
+
27
+ export interface RequestOptions {
28
+ transport?: "xhr" | "sendBeacon" | undefined;
29
+ send_immediately?: boolean | undefined;
30
+ }
31
+
32
+ export interface XhrHeadersDef {
33
+ [header: string]: any;
34
+ }
35
+
36
+ export interface HasOptedInOutOptions {
37
+ persistence_type: Persistence;
38
+ cookie_prefix: string;
39
+ }
40
+
41
+ export interface ClearOptOutInOutOptions extends HasOptedInOutOptions {
42
+ cookie_expiration: number;
43
+ cross_subdomain_cookie: boolean;
44
+ secure_cookie: boolean;
45
+ }
46
+
47
+ export interface InTrackingOptions extends ClearOptOutInOutOptions {
48
+ track: () => void;
49
+ track_event_name: string;
50
+ track_properties: Dict;
51
+ }
52
+
53
+ export interface OutTrackingOptions extends ClearOptOutInOutOptions {
54
+ delete_user: boolean;
55
+ }
56
+
57
+ export type RageClickConfig =
58
+ | boolean
59
+ | {
60
+ /** Distance threshold in pixels for clicks to be considered within the same area (default: 30) */
61
+ threshold_px?: number;
62
+ /** Time window in milliseconds for clicks to be considered rapid (default: 1000) */
63
+ timeout_ms?: number;
64
+ /** Number of clicks required to trigger a rage click event (default: 3) */
65
+ click_count?: number;
66
+ /** Whether to only track rage clicks on interactive elements like buttons, links, inputs (default: false) */
67
+ interactive_elements_only?: boolean;
68
+ };
69
+
70
+ export type DeadClickConfig =
71
+ | boolean
72
+ | {
73
+ /** Time in milliseconds to wait after a click before qualifying it as dead (default: 500) */
74
+ timeout_ms?: number;
75
+ };
76
+
77
+ export interface RegisterOptions {
78
+ persistent: boolean;
79
+ }
80
+
81
+ export type TrackPageView =
82
+ | boolean
83
+ | "url-with-path"
84
+ | "url-with-path-and-query-string"
85
+ | "full-url";
86
+
87
+ export interface AutocaptureConfig {
88
+ /**
89
+ * When set to `true`, Mixpanel will track element clicks. It will not track textContent unless `capture_text_content` is also set to `true`.
90
+ * @default true
91
+ */
92
+ click?: boolean;
93
+ /**
94
+ * When set to `true`, Mixpanel will track when an input is provided. It will not capture input content.
95
+ * @default true
96
+ */
97
+ input?: boolean;
98
+ /**
99
+ * When set, Mixpanel will collect pageviews when some components of the URL change — including UTM parameters.
100
+ * @default 'full-url'
101
+ */
102
+ pageview?: TrackPageView;
103
+ /**
104
+ * When set to `true`, Mixpanel will track rage clicks (multiple clicks in a short time on the same element).
105
+ * Can also be configured as an object to customize rage click detection parameters.
106
+ * @default true
107
+ */
108
+ rage_click?: RageClickConfig;
109
+ /**
110
+ * When set to `true`, Mixpanel will track dead clicks (clicks that produce no response).
111
+ * Can also be configured as an object to customize dead click detection parameters.
112
+ * @default true
113
+ */
114
+ dead_click?: DeadClickConfig;
115
+ /**
116
+ * When set, Mixpanel will collect page scrolls at specified scroll intervals.
117
+ * @default true
118
+ */
119
+ scroll?: boolean;
120
+ /**
121
+ * When set to `true`, Mixpanel will track form submissions (but not submission content).
122
+ * @default true
123
+ */
124
+ submit?: boolean;
125
+ /**
126
+ * When set to `true`, Mixpanel will capture the textContent of any element.
127
+ * @default false
128
+ */
129
+ capture_text_content?: boolean;
130
+ /** Enables specification of additional attributes to track. */
131
+ capture_extra_attrs?: string[];
132
+ /**
133
+ * Establishes the scroll depth intervals which trigger `Page Scroll` event.
134
+ * @default [25, 50, 75, 100]
135
+ */
136
+ scroll_depth_percent_checkpoints?: number[];
137
+ /**
138
+ * When set to true, overrides `scroll_depth_percentage_checkpoints` and captures all scroll events.
139
+ * @default false
140
+ */
141
+ scroll_capture_all?: boolean;
142
+ /** Opts out specific pages from Autocapture. */
143
+ block_url_regexes?: RegExp[];
144
+ /** Opts in specific pages to Autocapture. */
145
+ allow_url_regexes?: RegExp[];
146
+ /** Opts out specific classes from Autocapture. */
147
+ block_selectors?: string[];
148
+ /** Opts in specific classes to Autocapture. */
149
+ allow_selectors?: string[];
150
+ /** Opts out specific attributes from Autocapture. */
151
+ block_attrs?: string[];
152
+ /**
153
+ * A user-provided function that determines whether a specific element should be
154
+ * tracked via Autocapture or not. The function receives the element as its first
155
+ * argument, and the DOM event as its second argument, and should return `true` if
156
+ * the element should be tracked (otherwise the element will NOT be tracked).
157
+ */
158
+ allow_element_callback?: (element: Element, event: Event) => boolean;
159
+ /**
160
+ * A user-provided function that determines whether a specific element should be
161
+ * blocked from tracking via Autocapture or not. The function receives the element
162
+ * as its first argument, and the DOM event as its second argument, and should
163
+ * return `true` if the element should be blocked.
164
+ */
165
+ block_element_callback?: (element: Element, event: Event) => boolean;
166
+ }
167
+
168
+ export interface FlagsConfig {
169
+ context: Dict;
170
+ }
171
+
172
+ export interface BeforeSendHookPayload {
173
+ event: string;
174
+ properties: Record<string, any>;
175
+ }
176
+
177
+ export interface Config {
178
+ api_host: string;
179
+ api_routes: {
180
+ track?: string;
181
+ engage?: string;
182
+ groups?: string;
183
+ record?: string;
184
+ flags?: string;
185
+ };
186
+ api_method: string;
187
+ api_transport: string;
188
+ app_host: string;
189
+ api_payload_format: ApiPayloadFormat;
190
+ autotrack: boolean;
191
+ batch_autostart: boolean;
192
+ batch_requests: boolean;
193
+ cdn: string;
194
+ cookie_domain: string;
195
+ cross_site_cookie: boolean;
196
+ cross_subdomain_cookie: boolean;
197
+ error_reporter: (msg: string, err?: Error) => void;
198
+ flags: boolean | FlagsConfig;
199
+ persistence: Persistence;
200
+ persistence_name: string;
201
+ cookie_name: string;
202
+ loaded: (mixpanel: Mixpanel) => void;
203
+ store_google: boolean;
204
+ stop_utm_persistence: boolean;
205
+ save_referrer: boolean;
206
+ test: boolean;
207
+ verbose: boolean;
208
+ img: boolean;
209
+ /**
210
+ * @default false
211
+ * @see https://github.com/mixpanel/mixpanel-js/blob/master/doc/readme.io/javascript-full-api-reference.md#mixpanelset_config
212
+ */
213
+ debug: boolean;
214
+ track_links_timeout: number;
215
+ track_pageview: TrackPageView;
216
+ autocapture: boolean | AutocaptureConfig;
217
+ skip_first_touch_marketing: boolean;
218
+ cookie_expiration: number;
219
+ upgrade: boolean;
220
+ disable_persistence: boolean;
221
+ disable_cookie: boolean;
222
+ disable_notifications: boolean;
223
+ secure_cookie: boolean;
224
+ ip: boolean;
225
+ property_blacklist: string[];
226
+ xhr_headers: XhrHeadersDef;
227
+ opt_out_tracking_by_default: boolean;
228
+ opt_out_persistence_by_default: boolean;
229
+ opt_out_tracking_persistence_type: Persistence;
230
+ opt_out_tracking_cookie_prefix: string;
231
+ inapp_protocol: string;
232
+ inapp_link_new_window: boolean;
233
+ ignore_dnt: boolean;
234
+ batch_size: number;
235
+ batch_flush_interval_ms: number;
236
+ batch_request_timeout_ms: number;
237
+ recorder_src: string;
238
+ record_block_class: string | RegExp;
239
+ record_block_selector: string;
240
+ record_console: boolean;
241
+ record_network: boolean;
242
+ record_network_options: NetworkRecordOptions;
243
+ record_collect_fonts: boolean;
244
+ record_idle_timeout_ms: number;
245
+ record_inline_images: boolean;
246
+ record_mask_text_class: string | RegExp;
247
+ record_mask_text_selector: string | string[];
248
+ record_unmask_text_selector: string | string[];
249
+ record_mask_all_text: boolean;
250
+ record_mask_input_selector: string | string[];
251
+ record_unmask_input_selector: string | string[];
252
+ record_mask_all_inputs: boolean;
253
+ record_min_ms: number;
254
+ record_max_ms: number;
255
+ record_sessions_percent: number;
256
+ record_canvas: boolean;
257
+ recording_event_triggers: RecordingEventTriggers;
258
+ record_heatmap_data: boolean;
259
+ remote_settings_mode: RemoteSettingType;
260
+ hooks: {
261
+ before_identify?: (new_distinct_id: string) => string | null;
262
+ before_register?: (
263
+ props: Dict,
264
+ days_or_options?: number | Partial<RegisterOptions>
265
+ ) => Dict | Array<Dict | number | Partial<RegisterOptions>> | null;
266
+ before_register_once?: (
267
+ props: Dict,
268
+ default_value?: any,
269
+ days_or_options?: number | Partial<RegisterOptions>
270
+ ) => Dict | Array<any | Dict | number | Partial<RegisterOptions>> | null;
271
+ before_send_events?: (
272
+ event: BeforeSendHookPayload
273
+ ) => BeforeSendHookPayload | null;
274
+ before_track?: (
275
+ event_name: string,
276
+ properties: Dict
277
+ ) => string | Array<string | Dict> | null;
278
+ before_unregister?: (
279
+ property: string,
280
+ options?: Partial<RegisterOptions>
281
+ ) => string | Partial<RegisterOptions> | null;
282
+ };
283
+ }
284
+
285
+
286
+ export type VerboseResponse =
287
+ | {
288
+ status: 1;
289
+ error: null;
290
+ }
291
+ | {
292
+ status: 0;
293
+ error: string;
294
+ };
295
+
296
+ export type NormalResponse = 1 | 0;
297
+
298
+ export type Response = VerboseResponse | NormalResponse;
299
+
300
+ export type Callback = (response: Response) => void;
301
+
302
+ export interface People {
303
+ set(prop: string, to: any, callback?: Callback): void;
304
+ set(prop: Dict, callback?: Callback): void;
305
+ set_once(prop: string, to: any, callback?: Callback): void;
306
+ set_once(prop: Dict, callback?: Callback): void;
307
+ unset(prop: string[] | string, callback?: Callback): void;
308
+ increment(prop: string | Dict, callback?: Callback): void;
309
+ increment(prop: string, by: number, callback?: Callback): void;
310
+ remove(prop: string, value: any, callback?: Callback): void;
311
+ remove(prop: Dict, callback?: Callback): void;
312
+ append(prop: string, value: any, callback?: Callback): void;
313
+ append(prop: Dict, callback?: Callback): void;
314
+ union(prop: string, value: any, callback?: Callback): void;
315
+ union(prop: Dict, callback?: Callback): void;
316
+ track_charge(
317
+ amount: number,
318
+ propertiesOrCallback?: Dict | Callback,
319
+ callback?: Callback
320
+ ): void;
321
+ clear_charges(callback?: Callback): void;
322
+ delete_user(): void;
323
+ }
324
+
325
+ export interface Group {
326
+ remove(list_name: string, value: string, callback?: Callback): Group;
327
+ set<Prop extends string | Dict>(
328
+ prop: Prop,
329
+ to?: Prop extends string ? string : undefined,
330
+ callback?: Callback
331
+ ): Group;
332
+ set_once<Prop extends string | Dict>(
333
+ prop: Prop,
334
+ to?: Prop extends string ? string : undefined,
335
+ callback?: Callback
336
+ ): Group;
337
+ union(
338
+ list_name: string,
339
+ values: Array<string | number>,
340
+ callback?: Callback
341
+ ): Group;
342
+ unset(prop: string, callback?: Callback): void;
343
+ }
344
+
345
+ export interface FlagsVariant {
346
+ key: string;
347
+ value: any;
348
+ experiment_id?: string;
349
+ is_experiment_active?: boolean;
350
+ is_qa_tester?: boolean;
351
+ }
352
+
353
+ export interface FlagsUpdateContextOptions {
354
+ replace?: boolean;
355
+ }
356
+
357
+ export interface FlagsManager {
358
+ are_flags_ready(): boolean;
359
+ get_variant(
360
+ featureName: string,
361
+ fallback: FlagsVariant
362
+ ): Promise<FlagsVariant>;
363
+ get_variant_sync(featureName: string, fallback: FlagsVariant): FlagsVariant;
364
+ get_variant_value(featureName: string, fallbackValue: any): Promise<any>;
365
+ get_variant_value_sync(featureName: string, fallbackValue: any): any;
366
+ is_enabled(featureName: string, fallbackValue?: boolean): Promise<boolean>;
367
+ is_enabled_sync(featureName: string, fallbackValue?: boolean): boolean;
368
+ update_context(
369
+ context: Dict,
370
+ options?: FlagsUpdateContextOptions
371
+ ): Promise<void>;
372
+ }
373
+
374
+ export interface Mixpanel {
375
+ add_group(group_key: string, group_id: string, callback?: Callback): void;
376
+ alias(alias: string, original?: string): void;
377
+ clear_opt_in_out_tracking(options?: Partial<ClearOptOutInOutOptions>): void;
378
+ disable(events?: string[]): void;
379
+ flags: FlagsManager;
380
+ get_config(prop_name?: string): any;
381
+ get_distinct_id(): any;
382
+ get_group(group_key: string, group_id: string): Group;
383
+ get_property(property_name: string): any;
384
+ get_session_replay_url(): string;
385
+ has_opted_in_tracking(options?: Partial<HasOptedInOutOptions>): boolean;
386
+ has_opted_out_tracking(options?: Partial<HasOptedInOutOptions>): boolean;
387
+ identify(unique_id?: string): any;
388
+ init(token: string, config: Partial<Config>, name?: string): Mixpanel;
389
+ opt_in_tracking(options?: Partial<InTrackingOptions>): void;
390
+ opt_out_tracking(options?: Partial<OutTrackingOptions>): void;
391
+ push(item: PushItem): void;
392
+ register(
393
+ props: Dict,
394
+ days_or_options?: number | Partial<RegisterOptions>
395
+ ): void;
396
+ register_once(
397
+ props: Dict,
398
+ default_value?: any,
399
+ days_or_options?: number | Partial<RegisterOptions>
400
+ ): void;
401
+ remove_group(
402
+ group_key: string,
403
+ group_ids: string | string[] | number | number[],
404
+ callback?: Callback
405
+ ): void;
406
+ reset(): void;
407
+ set_config(config: Partial<Config>): void;
408
+ set_group(
409
+ group_key: string,
410
+ group_ids: string | string[] | number | number[],
411
+ callback?: Callback
412
+ ): void;
413
+ start_batch_senders(): void;
414
+ time_event(event_name: string): void;
415
+ track(
416
+ event_name: string,
417
+ properties?: Dict,
418
+ optionsOrCallback?: RequestOptions | Callback,
419
+ callback?: Callback
420
+ ): void;
421
+ track_forms(
422
+ query: Query,
423
+ event_name: string,
424
+ properties?: Dict | (() => void)
425
+ ): void;
426
+ track_links(
427
+ query: Query,
428
+ event_name: string,
429
+ properties?: Dict | (() => void)
430
+ ): void;
431
+ track_pageview(
432
+ properties?: Dict,
433
+ options?: { event_name?: string | undefined }
434
+ ): void;
435
+ track_with_groups(
436
+ event_name: string,
437
+ properties: Dict,
438
+ groups: Dict,
439
+ callback?: Callback
440
+ ): void;
441
+ unregister(property: string, options?: Partial<RegisterOptions>): void;
442
+ people: People;
443
+ start_batch_senders(): void;
444
+ start_session_recording(): void;
445
+ stop_session_recording(): void;
446
+ get_session_recording_properties(): { $mp_replay_id?: string } | {};
447
+ }
448
+
449
+ export interface OverridedMixpanel extends Mixpanel {
450
+ init(token: string, config: Partial<Config>, name: string): Mixpanel;
451
+ init(token: string, config?: Partial<Config>): undefined;
452
+ }
453
+
454
+ export function add_group(
455
+ group_key: string,
456
+ group_id: string,
457
+ callback?: Callback
458
+ ): void;
459
+ export function alias(alias: string, original?: string): void;
460
+ export function clear_opt_in_out_tracking(
461
+ options?: Partial<ClearOptOutInOutOptions>
462
+ ): void;
463
+ export function disable(events?: string[]): void;
464
+ export function get_config(prop_name?: string): any;
465
+ export function get_distinct_id(): any;
466
+ export function get_group(group_key: string, group_id: string): Group;
467
+ export function get_property(property_name: string): any;
468
+ export function has_opted_in_tracking(
469
+ options?: Partial<HasOptedInOutOptions>
470
+ ): boolean;
471
+ export function has_opted_out_tracking(
472
+ options?: Partial<HasOptedInOutOptions>
473
+ ): boolean;
474
+ export function identify(unique_id?: string): any;
475
+ export function init(
476
+ token: string,
477
+ config: Partial<Config>,
478
+ name: string
479
+ ): Mixpanel;
480
+ export function init(token: string, config?: Partial<Config>): undefined;
481
+ export function opt_in_tracking(options?: Partial<InTrackingOptions>): void;
482
+ export function opt_out_tracking(options?: Partial<OutTrackingOptions>): void;
483
+ export function push(item: PushItem): void;
484
+ export function register(
485
+ props: Dict,
486
+ days_or_options?: number | Partial<RegisterOptions>
487
+ ): void;
488
+ export function register_once(
489
+ props: Dict,
490
+ default_value?: any,
491
+ days_or_options?: number | Partial<RegisterOptions>
492
+ ): void;
493
+ export function remove_group(
494
+ group_key: string,
495
+ group_ids: string | string[] | number | number[],
496
+ callback?: Callback
497
+ ): void;
498
+ export function reset(): void;
499
+ export function set_config(config: Partial<Config>): void;
500
+ export function set_group(
501
+ group_key: string,
502
+ group_ids: string | string[] | number | number[],
503
+ callback?: Callback
504
+ ): void;
505
+ export function time_event(event_name: string): void;
506
+ export function track(
507
+ event_name: string,
508
+ properties?: Dict,
509
+ optionsOrCallback?: RequestOptions | Callback,
510
+ callback?: Callback
511
+ ): void;
512
+ export function track_forms(
513
+ query: Query,
514
+ event_name: string,
515
+ properties?: Dict | (() => void)
516
+ ): void;
517
+ export function track_links(
518
+ query: Query,
519
+ event_name: string,
520
+ properties?: Dict | (() => void)
521
+ ): void;
522
+ export function track_with_groups(
523
+ event_name: string,
524
+ properties: Dict,
525
+ groups: Dict,
526
+ callback?: Callback
527
+ ): void;
528
+ export function unregister(
529
+ property: string,
530
+ options?: Partial<RegisterOptions>
531
+ ): void;
532
+ export const people: People;
533
+ export function get_session_recording_properties():
534
+ | { $mp_replay_id?: string }
535
+ | {};
536
+
537
+ // Network Recording Plugin Types
538
+ export type InitiatorType =
539
+ | 'audio'
540
+ | 'beacon'
541
+ | 'body'
542
+ | 'css'
543
+ | 'early-hint'
544
+ | 'embed'
545
+ | 'fetch'
546
+ | 'frame'
547
+ | 'iframe'
548
+ | 'icon'
549
+ | 'image'
550
+ | 'img'
551
+ | 'input'
552
+ | 'link'
553
+ | 'navigation'
554
+ | 'object'
555
+ | 'ping'
556
+ | 'script'
557
+ | 'track'
558
+ | 'video'
559
+ | 'xmlhttprequest';
560
+
561
+ export interface NetworkRequest {
562
+ url: string;
563
+ method?: string;
564
+ initiatorType: InitiatorType;
565
+ status?: number;
566
+ startTime: number;
567
+ endTime: number;
568
+ timeOrigin: number;
569
+ requestHeaders?: Record<string, string>;
570
+ requestBody?: string;
571
+ responseHeaders?: Record<string, string>;
572
+ responseBody?: string;
573
+ }
574
+
575
+ export interface NetworkRecordOptions {
576
+ initiatorTypes?: InitiatorType[];
577
+ ignoreRequestUrls?: string[];
578
+ ignoreRequestFn?: (data: NetworkRequest) => boolean;
579
+ recordHeaders?: { request: string[]; response: string[] };
580
+ recordBodyUrls?: { request: string[]; response: string[] };
581
+ recordInitialRequests?: boolean;
582
+ }
583
+
584
+ export interface NetworkData {
585
+ requests: NetworkRequest[];
586
+ isInitial?: boolean;
587
+ }
588
+
589
+ declare const mixpanel: OverridedMixpanel;
590
+ export default mixpanel;