@statsig/client-core 1.8.0-beta.14 → 1.8.0-beta.15

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/client-core",
3
- "version": "1.8.0-beta.14",
3
+ "version": "1.8.0-beta.15",
4
4
  "dependencies": {},
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -76,6 +76,21 @@ class NetworkCore {
76
76
  const body = yield this._getPopulatedBody(Object.assign(Object.assign({}, args), networkProxyArgs));
77
77
  const url = yield this._getPopulatedURL(Object.assign(Object.assign({}, args), networkProxyArgs));
78
78
  const nav = navigator;
79
+ const isProxy = !url.includes('https://statsigapi.net/v1');
80
+ const parsedUrl = new URL(url);
81
+ const endpoint = parsedUrl.pathname;
82
+ if (!url.includes('https://prodregistryv2.org')) {
83
+ this.networkEvents.push({
84
+ value: isProxy ? 'proxy' : 'statsig',
85
+ eventName: 'proxy::network_request_tracking',
86
+ metadata: {
87
+ url,
88
+ endpoint,
89
+ },
90
+ time: Date.now(),
91
+ user: null,
92
+ });
93
+ }
79
94
  return nav.sendBeacon.bind(nav)(url, body);
80
95
  });
81
96
  }
@@ -229,7 +244,7 @@ class NetworkCore {
229
244
  _startBackgroundFlushNetworkEvents() {
230
245
  setInterval(() => {
231
246
  this._flushNetworkEvents();
232
- }, 10000);
247
+ }, 60000);
233
248
  }
234
249
  }
235
250
  exports.NetworkCore = NetworkCore;
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "1.8.0-beta.14";
1
+ export declare const SDK_VERSION = "1.8.0-beta.15";
2
2
  export type StatsigMetadata = {
3
3
  readonly [key: string]: string | undefined;
4
4
  readonly appVersion?: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '1.8.0-beta.14';
4
+ exports.SDK_VERSION = '1.8.0-beta.15';
5
5
  let metadata = {
6
6
  sdkVersion: exports.SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients