@kush_hemant/react-api-monitor 1.0.35 → 1.0.39

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ function monitorFetch() {
41
41
  const request = args[0] instanceof Request ? args[0] : new Request(args[0], args[1]);
42
42
  const url = request.url;
43
43
  const method = request.method || "GET";
44
- if (LOG_ENDPOINT && url.startsWith(LOG_ENDPOINT)) {
44
+ if (LOG_ENDPOINT && url.includes("/v1/logs")) {
45
45
  return originalFetch.apply(this, args);
46
46
  }
47
47
  let requestBody = null;
@@ -94,7 +94,7 @@ function monitorXHR() {
94
94
  };
95
95
  XMLHttpRequest.prototype.send = function(body) {
96
96
  const start = Date.now();
97
- if (this._url && LOG_ENDPOINT && this._url.includes(LOG_ENDPOINT)) {
97
+ if (this._url && LOG_ENDPOINT && this._url.includes("/v1/logs")) {
98
98
  return originalSend.call(this, body);
99
99
  }
100
100
  this.addEventListener("loadend", () => {
@@ -170,10 +170,10 @@ function startNetworkMonitoring() {
170
170
 
171
171
  // src/index.js
172
172
  function initMonitoring(options) {
173
- configureSender({
174
- endpoint: options.endpoint,
175
- apiKey: options.apiKey
176
- });
173
+ configureSender(
174
+ options.endpoint,
175
+ options.apiKey
176
+ );
177
177
  startNetworkMonitoring();
178
178
  }
179
179
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kush_hemant/react-api-monitor",
3
- "version": "1.0.35",
3
+ "version": "1.0.39",
4
4
  "description": "Automatic API monitoring SDK for React apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",