featurely-site-manager 1.1.9 → 1.1.10
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/index.js +15 -10
- package/dist/index.mjs +15 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -396,16 +396,21 @@ var _SiteManager = class _SiteManager {
|
|
|
396
396
|
platform: typeof navigator !== "undefined" ? navigator.platform : void 0,
|
|
397
397
|
appVersion: this.config.appVersion
|
|
398
398
|
});
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
console.error(
|
|
399
|
+
try {
|
|
400
|
+
const res = await fetch(url, {
|
|
401
|
+
method: "POST",
|
|
402
|
+
headers: { "Content-Type": "application/json" },
|
|
403
|
+
body: payload,
|
|
404
|
+
keepalive: true
|
|
405
|
+
});
|
|
406
|
+
if (!res.ok) {
|
|
407
|
+
const body = await res.text().catch(() => "(unreadable)");
|
|
408
|
+
console.error(`[Featurely] Analytics event "${event.eventName}" rejected by server: ${res.status} ${res.statusText} \u2014 ${body}`);
|
|
409
|
+
}
|
|
410
|
+
} catch (fetchError) {
|
|
411
|
+
const sentViaBeacon = typeof navigator !== "undefined" && typeof navigator.sendBeacon === "function" && navigator.sendBeacon(url, payload);
|
|
412
|
+
if (!sentViaBeacon) {
|
|
413
|
+
console.error(`[Featurely] Failed to send analytics event "${event.eventName}":`, fetchError);
|
|
409
414
|
}
|
|
410
415
|
}
|
|
411
416
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -361,16 +361,21 @@ var _SiteManager = class _SiteManager {
|
|
|
361
361
|
platform: typeof navigator !== "undefined" ? navigator.platform : void 0,
|
|
362
362
|
appVersion: this.config.appVersion
|
|
363
363
|
});
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
console.error(
|
|
364
|
+
try {
|
|
365
|
+
const res = await fetch(url, {
|
|
366
|
+
method: "POST",
|
|
367
|
+
headers: { "Content-Type": "application/json" },
|
|
368
|
+
body: payload,
|
|
369
|
+
keepalive: true
|
|
370
|
+
});
|
|
371
|
+
if (!res.ok) {
|
|
372
|
+
const body = await res.text().catch(() => "(unreadable)");
|
|
373
|
+
console.error(`[Featurely] Analytics event "${event.eventName}" rejected by server: ${res.status} ${res.statusText} \u2014 ${body}`);
|
|
374
|
+
}
|
|
375
|
+
} catch (fetchError) {
|
|
376
|
+
const sentViaBeacon = typeof navigator !== "undefined" && typeof navigator.sendBeacon === "function" && navigator.sendBeacon(url, payload);
|
|
377
|
+
if (!sentViaBeacon) {
|
|
378
|
+
console.error(`[Featurely] Failed to send analytics event "${event.eventName}":`, fetchError);
|
|
374
379
|
}
|
|
375
380
|
}
|
|
376
381
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "featurely-site-manager",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.10",
|
|
4
4
|
"description": "Complete site management SDK for maintenance mode, status messages, feature flags, version checking, and analytics",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|