@formo/analytics 1.31.0 → 1.33.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.
@@ -24,6 +24,22 @@ var CLICK_ID_PARAMS = [
24
24
  "rdt_cid", // Reddit Ads
25
25
  "ttclid", // TikTok Ads
26
26
  ];
27
+ /**
28
+ * Query parameters that are ALWAYS stripped from forwarded and stored URLs,
29
+ * regardless of consumer configuration, because they carry high-sensitivity
30
+ * secrets that must never reach Formo:
31
+ * - privy_oauth_code: Privy OAuth authorization code
32
+ * - privy_oauth_state: Privy OAuth CSRF state token
33
+ * - privy_oauth_provider: Privy OAuth provider identifier
34
+ *
35
+ * Consumers can extend the denylist via `tracking.excludeQueryParams` but
36
+ * cannot remove these built-ins. Matched case-insensitively.
37
+ */
38
+ var DEFAULT_EXCLUDED_QUERY_PARAMS = [
39
+ "privy_oauth_code",
40
+ "privy_oauth_state",
41
+ "privy_oauth_provider",
42
+ ];
27
43
  /**
28
44
  * Fields that should be excluded from page event properties parsing
29
45
  * These are either:
@@ -50,5 +66,5 @@ var PAGE_PROPERTIES_EXCLUDED_FIELDS = new Set(__spreadArray(__spreadArray([
50
66
  'hash',
51
67
  'query',
52
68
  ], false));
53
- export { CHANNEL, VERSION, CLICK_ID_PARAMS, PAGE_PROPERTIES_EXCLUDED_FIELDS };
69
+ export { CHANNEL, VERSION, CLICK_ID_PARAMS, DEFAULT_EXCLUDED_QUERY_PARAMS, PAGE_PROPERTIES_EXCLUDED_FIELDS, };
54
70
  //# sourceMappingURL=constants.js.map
@@ -72,6 +72,34 @@ export interface TrackingOptions {
72
72
  excludeHosts?: string[];
73
73
  excludePaths?: string[];
74
74
  excludeChains?: ChainID[];
75
+ /**
76
+ * IANA timezone names to opt out of tracking entirely. When the visitor's
77
+ * resolved timezone (via `Intl.DateTimeFormat().resolvedOptions().timeZone`)
78
+ * matches one of these, no events are enqueued or sent — including `identify`
79
+ * and `connect`. Matched case-insensitively against the full timezone string.
80
+ *
81
+ * Note: this is client-side, timezone-derived geolocation. It is best-effort
82
+ * and can be bypassed (a VPN does not change the browser timezone, and users
83
+ * can change their OS timezone). For authoritative jurisdiction blocking, use
84
+ * server-side IP geolocation at your ingest endpoint instead.
85
+ *
86
+ * @example ["Europe/London", "America/New_York"]
87
+ */
88
+ excludeTimezones?: string[];
89
+ /**
90
+ * Additional query parameter names to strip from forwarded and stored URLs,
91
+ * on top of a built-in always-on denylist (currently `privy_oauth_code`,
92
+ * `privy_oauth_state`, and `privy_oauth_provider`) that cannot be disabled.
93
+ * Matched case-insensitively. Excluded params are stripped from the captured
94
+ * page URL, query string, per-parameter page properties, and referrer before
95
+ * any event is sent. The URL hash/fragment is intentionally left untouched.
96
+ *
97
+ * Mirrors Mixpanel's `property_blacklist` and PostHog's `property_denylist`,
98
+ * scoped here to URL query parameters.
99
+ *
100
+ * @example ["token", "access_token", "email", "signature"]
101
+ */
102
+ excludeQueryParams?: string[];
75
103
  }
76
104
  /**
77
105
  * Configuration options for controlling wallet event autocapture
@@ -3,4 +3,5 @@ export * from "./base";
3
3
  export * from "./converter";
4
4
  export * from "./generate";
5
5
  export * from "./hash";
6
+ export * from "./timezone";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,5 @@ export * from "./base";
3
3
  export * from "./converter";
4
4
  export * from "./generate";
5
5
  export * from "./hash";
6
+ export * from "./timezone";
6
7
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolve the current IANA timezone (e.g. "Europe/London") via the Intl API.
3
+ * Returns "" when the timezone cannot be resolved (e.g. Intl unavailable).
4
+ */
5
+ declare const getTimezone: () => string;
6
+ export { getTimezone };
7
+ //# sourceMappingURL=timezone.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { logger } from "../logger";
2
+ /**
3
+ * Resolve the current IANA timezone (e.g. "Europe/London") via the Intl API.
4
+ * Returns "" when the timezone cannot be resolved (e.g. Intl unavailable).
5
+ */
6
+ var getTimezone = function () {
7
+ try {
8
+ return Intl.DateTimeFormat().resolvedOptions().timeZone || "";
9
+ }
10
+ catch (error) {
11
+ logger.error("Error resolving timezone:", error);
12
+ return "";
13
+ }
14
+ };
15
+ export { getTimezone };
16
+ //# sourceMappingURL=timezone.js.map