zubbl-sdk 1.1.14 → 1.1.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.
@@ -54,7 +54,10 @@ async function flushEndpointBuffer() {
54
54
  "X-Tenant-Id": config.tenantId,
55
55
  "X-App-Id": config.appId,
56
56
  };
57
-
57
+ const firstWithUser = batch.find(ev => ev.external_user_id);
58
+ if (firstWithUser?.external_user_id) {
59
+ headers["X-External-User-Id"] = firstWithUser.external_user_id;
60
+ }
58
61
  console.log("[Zubbl SDK][Telemetry] Flushing batch:", {
59
62
  url: telemetryUrl,
60
63
  count: batch.length,
@@ -52,7 +52,10 @@ async function flushEndpointBuffer() {
52
52
  "X-Tenant-Id": config.tenantId,
53
53
  "X-App-Id": config.appId,
54
54
  };
55
-
55
+ const firstWithUser = batch.find(ev => ev.external_user_id);
56
+ if (firstWithUser?.external_user_id) {
57
+ headers["X-External-User-Id"] = firstWithUser.external_user_id;
58
+ }
56
59
  console.log("[Zubbl SDK][Telemetry] Flushing batch:", {
57
60
  url: telemetryUrl,
58
61
  count: batch.length,
@@ -56,7 +56,10 @@
56
56
  "X-Tenant-Id": config.tenantId,
57
57
  "X-App-Id": config.appId,
58
58
  };
59
-
59
+ const firstWithUser = batch.find(ev => ev.external_user_id);
60
+ if (firstWithUser?.external_user_id) {
61
+ headers["X-External-User-Id"] = firstWithUser.external_user_id;
62
+ }
60
63
  console.log("[Zubbl SDK][Telemetry] Flushing batch:", {
61
64
  url: telemetryUrl,
62
65
  count: batch.length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zubbl-sdk",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "type": "module",
5
5
  "description": "Zubbl SDK for secure policy enforcement (browser, Node, universal)",
6
6
  "main": "dist/zubbl-sdk.cjs.js",