@statsig/web-analytics 3.25.3 → 3.25.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/web-analytics",
3
- "version": "3.25.3",
3
+ "version": "3.25.5",
4
4
  "license": "ISC",
5
5
  "homepage": "https://github.com/statsig-io/js-client-monorepo",
6
6
  "repository": {
@@ -9,8 +9,8 @@
9
9
  "directory": "packages/web-analytics"
10
10
  },
11
11
  "dependencies": {
12
- "@statsig/client-core": "3.25.3",
13
- "@statsig/js-client": "3.25.3",
12
+ "@statsig/client-core": "3.25.5",
13
+ "@statsig/js-client": "3.25.5",
14
14
  "web-vitals": "5.0.3"
15
15
  },
16
16
  "jsdelivr": "./build/statsig-web-analytics.min.js",
@@ -5,7 +5,7 @@ const web_vitals_1 = require("web-vitals");
5
5
  const client_core_1 = require("@statsig/client-core");
6
6
  const AutoCaptureEvent_1 = require("./AutoCaptureEvent");
7
7
  const commonUtils_1 = require("./utils/commonUtils");
8
- const VALID_METRIC_NAMES = ['CLS', 'FCP', 'LCP', 'TTFB'];
8
+ const VALID_METRIC_NAMES = ['CLS', 'FCP', 'INP', 'LCP', 'TTFB'];
9
9
  class WebVitalsManager {
10
10
  constructor(_enqueueFn, _errorBoundary) {
11
11
  this._enqueueFn = _enqueueFn;
@@ -30,6 +30,7 @@ class WebVitalsManager {
30
30
  }
31
31
  (0, web_vitals_1.onCLS)((metric) => this._handleMetric(metric));
32
32
  (0, web_vitals_1.onFCP)((metric) => this._handleMetric(metric));
33
+ (0, web_vitals_1.onINP)((metric) => this._handleMetric(metric));
33
34
  (0, web_vitals_1.onLCP)((metric) => this._handleMetric(metric));
34
35
  (0, web_vitals_1.onTTFB)((metric) => this._handleMetric(metric));
35
36
  this._isInitialized = true;
@@ -107,9 +107,15 @@ function _isOutboundLink(metadata) {
107
107
  }
108
108
  const href = metadata['href'];
109
109
  if (href) {
110
- const currentUrl = (0, commonUtils_1._getSafeUrl)();
111
- const linkUrl = new URL(href);
112
- return currentUrl.host !== linkUrl.host;
110
+ try {
111
+ const currentUrl = (0, commonUtils_1._getSafeUrl)();
112
+ const linkUrl = new URL(href);
113
+ return currentUrl.host !== linkUrl.host;
114
+ }
115
+ catch (_b) {
116
+ // Invalid URL, treat as non-outbound
117
+ return false;
118
+ }
113
119
  }
114
120
  return false;
115
121
  }