@v-tilt/browser 1.10.0 → 1.10.2

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/dist/module.d.ts CHANGED
@@ -71,6 +71,8 @@ interface VTiltConfig {
71
71
  capture_pageview?: boolean | "auto";
72
72
  /** Enable page leave tracking */
73
73
  capture_pageleave?: boolean | "if_capture_pageview";
74
+ /** Enable rage click detection (rapid clicks in same area) */
75
+ rageclick?: boolean;
74
76
  /** Disable compression */
75
77
  disable_compression?: boolean;
76
78
  /** Whether to stringify payload before sending */
@@ -275,6 +277,34 @@ interface AutocaptureOptions {
275
277
  * Capture text content from copy/cut events (default: false)
276
278
  */
277
279
  capture_copied_text?: boolean;
280
+ /**
281
+ * Mask all text content in captured elements (use placeholder).
282
+ * Overrides VTiltConfig.mask_all_text for autocapture specifically.
283
+ */
284
+ mask_all_text?: boolean;
285
+ /**
286
+ * Mask all element attributes (only safe attributes or none).
287
+ * Overrides VTiltConfig.mask_all_element_attributes for autocapture specifically.
288
+ */
289
+ mask_all_element_attributes?: boolean;
290
+ /**
291
+ * Capture form field values on change events (default: false)
292
+ *
293
+ * When enabled, captures $el_value and $selected_text properties:
294
+ * - $el_value: The programmatic value (input.value, option.value, checkbox checked state)
295
+ * - $selected_text: Human-readable selection (option text, checkbox label)
296
+ *
297
+ * Protected by multiple privacy layers:
298
+ * - Password and hidden inputs are never captured
299
+ * - Fields with sensitive names (cc, pass, ssn, etc.) are skipped
300
+ * - Credit card and SSN patterns in values are filtered out
301
+ * - Elements with vt-sensitive or vt-no-capture classes are excluded
302
+ *
303
+ * Use case: Tracking search keywords, filter selections, etc.
304
+ *
305
+ * @default false
306
+ */
307
+ capture_element_values?: boolean;
278
308
  }
279
309
  /** Mask options for input elements in session recording */
280
310
  interface SessionRecordingMaskInputOptions {
@@ -404,6 +434,10 @@ interface RemoteConfig {
404
434
  ipAnonymization?: boolean;
405
435
  };
406
436
  featureFlags?: FeatureFlagsConfig;
437
+ /** Whether to send elements as chain string (PostHog compatibility) */
438
+ elementsChainAsString?: boolean;
439
+ /** Server-side autocapture opt-out */
440
+ autocapture_opt_out?: boolean;
407
441
  }
408
442
 
409
443
  /**
@@ -864,64 +898,11 @@ declare class HistoryAutocapture implements Feature {
864
898
  private _capturePageview;
865
899
  }
866
900
 
867
- /**
868
- * Autocapture Types
869
- *
870
- * Type definitions for the DOM autocapture feature.
871
- * Following PostHog's patterns for element capture and privacy.
872
- */
873
- /**
874
- * Autocapture configuration options
875
- * Controls what events and elements are captured
876
- */
877
- interface AutocaptureConfig {
878
- /**
879
- * Enable autocapture (default: true when autocapture config is present)
880
- */
881
- enabled?: boolean;
882
- /**
883
- * URL patterns to allow autocapture on (default: all URLs)
884
- * Supports strings (exact match) and RegExp patterns
885
- */
886
- url_allowlist?: (string | RegExp)[];
887
- /**
888
- * URL patterns to exclude from autocapture
889
- * Supports strings (exact match) and RegExp patterns
890
- */
891
- url_ignorelist?: (string | RegExp)[];
892
- /**
893
- * DOM events to capture (default: ['click', 'change', 'submit'])
894
- */
895
- dom_event_allowlist?: AutocaptureEventType[];
896
- /**
897
- * Element tags to capture (default: ['a', 'button', 'form', 'input', 'select', 'textarea', 'label'])
898
- */
899
- element_allowlist?: string[];
900
- /**
901
- * CSS selectors to allow for capture (elements matching these are always captured)
902
- * Example: ['[data-track]', '.track-click']
903
- */
904
- css_selector_allowlist?: string[];
905
- /**
906
- * Element attributes to exclude from capture
907
- * Example: ['data-secret', 'aria-label']
908
- */
909
- element_attribute_ignorelist?: string[];
910
- /**
911
- * Capture text content from copy/cut events (default: false)
912
- */
913
- capture_copied_text?: boolean;
914
- }
915
- /**
916
- * Supported DOM event types for autocapture
917
- */
918
- type AutocaptureEventType = "click" | "change" | "submit";
919
-
920
901
  /**
921
902
  * Autocapture
922
903
  *
923
904
  * Automatic DOM event capture for clicks, form submissions, and input changes.
924
- * Following PostHog's privacy-first approach with element chain tracking.
905
+ * Privacy-first approach with element chain tracking and sensitive data filtering.
925
906
  */
926
907
 
927
908
  /**
@@ -931,72 +912,30 @@ type AutocaptureEventType = "click" | "change" | "submit";
931
912
  declare class Autocapture implements Feature {
932
913
  readonly name = "Autocapture";
933
914
  private _instance;
934
- private _config;
935
- private _isStarted;
936
- private _eventHandlers;
937
- constructor(instance: VTilt, config?: AutocaptureConfig);
938
- /**
939
- * Extract autocapture config from VTiltConfig.
940
- * This allows the feature to be self-contained - vtilt.ts doesn't need
941
- * to know about autocapture-specific config transformations.
942
- */
943
- static extractConfig(config: VTiltConfig): AutocaptureConfig;
944
- /**
945
- * Check if autocapture is enabled
946
- */
915
+ private _initialized;
916
+ private _isDisabledServerSide;
917
+ private _elementSelectors;
918
+ private _rageclicks;
919
+ private _elementsChainAsString;
920
+ constructor(instance: VTilt);
921
+ private get _config();
947
922
  get isEnabled(): boolean;
948
- /**
949
- * Check if autocapture is currently active
950
- */
951
923
  get isStarted(): boolean;
952
- /**
953
- * Start autocapture if enabled (Feature interface)
954
- */
955
924
  startIfEnabled(): void;
956
- /**
957
- * Stop autocapture (Feature interface)
958
- */
959
925
  stop(): void;
926
+ onConfigUpdate(_config: VTiltConfig): void;
927
+ onRemoteConfig(response: RemoteConfig): void;
960
928
  /**
961
- * Handle config updates (Feature interface)
962
- */
963
- onConfigUpdate(config: VTiltConfig): void;
964
- /**
965
- * Update autocapture configuration
966
- */
967
- updateConfig(config: Partial<AutocaptureConfig>): void;
968
- /**
969
- * Start autocapture
970
- */
971
- private _start;
972
- /**
973
- * Add DOM event handlers
974
- */
975
- private _addEventHandlers;
976
- /**
977
- * Remove DOM event handlers
978
- */
979
- private _removeEventHandlers;
980
- /**
981
- * Create event handler for a specific event type
982
- */
983
- private _createEventHandler;
984
- /**
985
- * Capture a DOM event
929
+ * Update autocapture configuration (for programmatic control)
986
930
  */
931
+ updateConfig(config: Partial<{
932
+ enabled: boolean;
933
+ }>): void;
934
+ setElementSelectors(selectors: Set<string>): void;
935
+ getElementSelectors(element: Element | null): string[] | null;
936
+ private _addDomEventHandlers;
987
937
  private _captureEvent;
988
- /**
989
- * Build properties for an autocapture event
990
- */
991
- private _buildEventProperties;
992
- /**
993
- * Add element-specific properties
994
- */
995
- private _addElementSpecificProps;
996
- /**
997
- * Add event-specific properties
998
- */
999
- private _addEventSpecificProps;
938
+ private _isBrowserSupported;
1000
939
  }
1001
940
 
1002
941
  /**
@@ -1662,7 +1601,7 @@ declare class SimpleEventEmitter {
1662
1601
  */
1663
1602
 
1664
1603
  declare class VTilt {
1665
- readonly version = "1.10.0";
1604
+ readonly version: string;
1666
1605
  __loaded: boolean;
1667
1606
  __request_queue: QueuedRequest[];
1668
1607
  historyAutocapture?: HistoryAutocapture;