@jitsu/js 1.9.7 → 1.9.8

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/jitsu.cjs.js CHANGED
@@ -1404,7 +1404,7 @@ function adjustPayload(payload, config, storage, s2s) {
1404
1404
  library: {
1405
1405
  name: jitsuLibraryName,
1406
1406
  version: jitsuVersion,
1407
- env: s2s ? "node" : "browser",
1407
+ env: isInBrowser() ? "browser" : "node",
1408
1408
  },
1409
1409
  consent: ((_c = config.privacy) === null || _c === void 0 ? void 0 : _c.consentCategories)
1410
1410
  ? {
@@ -1548,7 +1548,7 @@ function send(method, payload, jitsuConfig, instance, store) {
1548
1548
  console.log(`[JITSU DEBUG] sending '${method}' event:`, payload);
1549
1549
  return;
1550
1550
  }
1551
- const s2s = jitsuConfig.s2s === undefined ? !isInBrowser() : jitsuConfig.s2s;
1551
+ const s2s = !!jitsuConfig.s2s;
1552
1552
  const url = s2s ? `${jitsuConfig.host}/api/s/s2s/${method}` : `${jitsuConfig.host}/api/s/${method}`;
1553
1553
  const fetch = jitsuConfig.fetch || globalThis.fetch;
1554
1554
  if (!fetch) {
@@ -1558,7 +1558,7 @@ function send(method, payload, jitsuConfig, instance, store) {
1558
1558
  // if (jitsuConfig.debug) {
1559
1559
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
1560
1560
  // }
1561
- const adjustedPayload = adjustPayload(payload, jitsuConfig, store, s2s);
1561
+ const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
1562
1562
  const abortController = jitsuConfig.fetchTimeoutMs ? new AbortController() : undefined;
1563
1563
  const abortTimeout = jitsuConfig.fetchTimeoutMs
1564
1564
  ? setTimeout(() => {
package/dist/jitsu.es.js CHANGED
@@ -1402,7 +1402,7 @@ function adjustPayload(payload, config, storage, s2s) {
1402
1402
  library: {
1403
1403
  name: jitsuLibraryName,
1404
1404
  version: jitsuVersion,
1405
- env: s2s ? "node" : "browser",
1405
+ env: isInBrowser() ? "browser" : "node",
1406
1406
  },
1407
1407
  consent: ((_c = config.privacy) === null || _c === void 0 ? void 0 : _c.consentCategories)
1408
1408
  ? {
@@ -1546,7 +1546,7 @@ function send(method, payload, jitsuConfig, instance, store) {
1546
1546
  console.log(`[JITSU DEBUG] sending '${method}' event:`, payload);
1547
1547
  return;
1548
1548
  }
1549
- const s2s = jitsuConfig.s2s === undefined ? !isInBrowser() : jitsuConfig.s2s;
1549
+ const s2s = !!jitsuConfig.s2s;
1550
1550
  const url = s2s ? `${jitsuConfig.host}/api/s/s2s/${method}` : `${jitsuConfig.host}/api/s/${method}`;
1551
1551
  const fetch = jitsuConfig.fetch || globalThis.fetch;
1552
1552
  if (!fetch) {
@@ -1556,7 +1556,7 @@ function send(method, payload, jitsuConfig, instance, store) {
1556
1556
  // if (jitsuConfig.debug) {
1557
1557
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
1558
1558
  // }
1559
- const adjustedPayload = adjustPayload(payload, jitsuConfig, store, s2s);
1559
+ const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
1560
1560
  const abortController = jitsuConfig.fetchTimeoutMs ? new AbortController() : undefined;
1561
1561
  const abortTimeout = jitsuConfig.fetchTimeoutMs
1562
1562
  ? setTimeout(() => {
package/dist/web/p.js.txt CHANGED
@@ -1405,7 +1405,7 @@
1405
1405
  library: {
1406
1406
  name: jitsuLibraryName,
1407
1407
  version: jitsuVersion,
1408
- env: s2s ? "node" : "browser",
1408
+ env: isInBrowser() ? "browser" : "node",
1409
1409
  },
1410
1410
  consent: ((_c = config.privacy) === null || _c === void 0 ? void 0 : _c.consentCategories)
1411
1411
  ? {
@@ -1549,7 +1549,7 @@
1549
1549
  console.log(`[JITSU DEBUG] sending '${method}' event:`, payload);
1550
1550
  return;
1551
1551
  }
1552
- const s2s = jitsuConfig.s2s === undefined ? !isInBrowser() : jitsuConfig.s2s;
1552
+ const s2s = !!jitsuConfig.s2s;
1553
1553
  const url = s2s ? `${jitsuConfig.host}/api/s/s2s/${method}` : `${jitsuConfig.host}/api/s/${method}`;
1554
1554
  const fetch = jitsuConfig.fetch || globalThis.fetch;
1555
1555
  if (!fetch) {
@@ -1559,7 +1559,7 @@
1559
1559
  // if (jitsuConfig.debug) {
1560
1560
  // console.log(`[JITSU] Sending event to ${url}: `, JSON.stringify(payload, null, 2));
1561
1561
  // }
1562
- const adjustedPayload = adjustPayload(payload, jitsuConfig, store, s2s);
1562
+ const adjustedPayload = adjustPayload(payload, jitsuConfig, store);
1563
1563
  const abortController = jitsuConfig.fetchTimeoutMs ? new AbortController() : undefined;
1564
1564
  const abortTimeout = jitsuConfig.fetchTimeoutMs
1565
1565
  ? setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/js",
3
- "version": "1.9.7",
3
+ "version": "1.9.8",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "main": "dist/jitsu.cjs.js",
@@ -35,8 +35,8 @@
35
35
  "rollup": "^3.2.5",
36
36
  "ts-jest": "29.0.5",
37
37
  "typescript": "^5.5.4",
38
- "@jitsu/protocols": "1.9.7",
39
- "jsondiffpatch": "1.9.7"
38
+ "@jitsu/protocols": "1.9.8",
39
+ "jsondiffpatch": "1.9.8"
40
40
  },
41
41
  "dependencies": {
42
42
  "analytics": "0.8.9"
@@ -427,7 +427,7 @@ function adjustPayload(
427
427
  library: {
428
428
  name: jitsuLibraryName,
429
429
  version: jitsuVersion,
430
- env: s2s ? "node" : "browser",
430
+ env: isInBrowser() ? "browser" : "node",
431
431
  },
432
432
  consent: config.privacy?.consentCategories
433
433
  ? {
@@ -638,7 +638,7 @@ async function send(
638
638
  console.log(`[JITSU DEBUG] sending '${method}' event:`, payload);
639
639
  return;
640
640
  }
641
- const s2s = jitsuConfig.s2s === undefined ? !isInBrowser() : jitsuConfig.s2s;
641
+ const s2s = !!jitsuConfig.s2s;
642
642
  const url = s2s ? `${jitsuConfig.host}/api/s/s2s/${method}` : `${jitsuConfig.host}/api/s/${method}`;
643
643
  const fetch = jitsuConfig.fetch || globalThis.fetch;
644
644
  if (!fetch) {