@v-tilt/browser 1.1.1 → 1.1.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/types.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Type definitions for the VTilt tracking SDK.
5
5
  * Following PostHog's patterns where applicable.
6
6
  */
7
- import type { PersonProfilesMode } from './constants';
7
+ import type { PersonProfilesMode } from "./constants";
8
8
  export interface VTiltConfig {
9
9
  /** Project identifier (required) */
10
10
  token: string;
@@ -42,9 +42,9 @@ export interface VTiltConfig {
42
42
  /** Enable web vitals tracking */
43
43
  capture_performance?: boolean;
44
44
  /** Enable page view tracking */
45
- capture_pageview?: boolean | 'auto';
45
+ capture_pageview?: boolean | "auto";
46
46
  /** Enable page leave tracking */
47
- capture_pageleave?: boolean | 'if_capture_pageview';
47
+ capture_pageleave?: boolean | "if_capture_pageview";
48
48
  /** Disable compression */
49
49
  disable_compression?: boolean;
50
50
  /** Whether to stringify payload before sending */
@@ -124,7 +124,7 @@ export interface SessionData {
124
124
  * - 'sessionStorage': Stores all data in sessionStorage
125
125
  * - 'memory': Stores all data in memory only (no persistence)
126
126
  */
127
- export type PersistenceMethod = 'localStorage+cookie' | 'cookie' | 'localStorage' | 'sessionStorage' | 'memory';
127
+ export type PersistenceMethod = "localStorage+cookie" | "cookie" | "localStorage" | "sessionStorage" | "memory";
128
128
  /** User identity state */
129
129
  export interface UserIdentity {
130
130
  /** Current distinct ID (null if anonymous) */
@@ -136,7 +136,7 @@ export interface UserIdentity {
136
136
  /** User properties */
137
137
  properties: Properties;
138
138
  /** Identity state */
139
- user_state: 'anonymous' | 'identified';
139
+ user_state: "anonymous" | "identified";
140
140
  }
141
141
  export interface UserProperties {
142
142
  [key: string]: any;
@@ -149,7 +149,7 @@ export interface WebVitalMetric {
149
149
  name: string;
150
150
  value: number;
151
151
  delta: number;
152
- rating: 'good' | 'needs-improvement' | 'poor';
152
+ rating: "good" | "needs-improvement" | "poor";
153
153
  id: string;
154
154
  navigationType: string;
155
155
  }
@@ -164,10 +164,10 @@ export interface FeatureFlagsConfig {
164
164
  [flagKey: string]: boolean | string;
165
165
  }
166
166
  export type SessionIdChangedCallback = (newSessionId: string, previousSessionId: string | null, changeInfo: {
167
- reason: 'timeout' | 'new_session' | 'reset';
167
+ reason: "timeout" | "new_session" | "reset";
168
168
  }) => void;
169
169
  export interface RequestOptions {
170
- method?: 'POST' | 'GET';
170
+ method?: "POST" | "GET";
171
171
  headers?: Record<string, string>;
172
172
  timeout?: number;
173
173
  retry?: boolean;
package/lib/config.js CHANGED
@@ -21,7 +21,10 @@ class ConfigManager {
21
21
  ...initialConfig,
22
22
  };
23
23
  // Parse basic attributes
24
- config.api_host = script.getAttribute("data-api-host") || script.getAttribute("data-host") || initialConfig.api_host;
24
+ config.api_host =
25
+ script.getAttribute("data-api-host") ||
26
+ script.getAttribute("data-host") ||
27
+ initialConfig.api_host;
25
28
  config.proxy = script.getAttribute("data-proxy") || initialConfig.proxy;
26
29
  config.proxyUrl =
27
30
  script.getAttribute("data-proxy-url") || initialConfig.proxyUrl;
@@ -147,7 +147,7 @@ export declare const PROP_GEOIP_LONGITUDE = "$geoip_longitude";
147
147
  /** Initial GeoIP properties (set once) */
148
148
  export declare const PROP_INITIAL_GEOIP_PREFIX = "$initial_geoip_";
149
149
  export declare const UTM_PARAMS: readonly ["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "gclid", "gad_source", "gbraid", "wbraid", "fbclid", "msclkid", "twclid", "li_fat_id", "mc_cid", "igshid", "ttclid"];
150
- export type UTMParam = typeof UTM_PARAMS[number];
150
+ export type UTMParam = (typeof UTM_PARAMS)[number];
151
151
  export declare const PERSISTENCE_RESERVED_PROPERTIES: string[];
152
152
  /**
153
153
  * Person profiles configuration mode
@@ -155,7 +155,7 @@ export declare const PERSISTENCE_RESERVED_PROPERTIES: string[];
155
155
  * - 'identified_only': Only create profiles when user is identified
156
156
  * - 'never': Never create person profiles (events only)
157
157
  */
158
- export type PersonProfilesMode = 'always' | 'identified_only' | 'never';
158
+ export type PersonProfilesMode = "always" | "identified_only" | "never";
159
159
  /** Default API host */
160
160
  export declare const DEFAULT_API_HOST = "https://api.vtilt.io";
161
161
  /** Default flush interval (ms) */