@kameleoon/javascript-sdk-core 5.14.2 → 5.14.4

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/CHANGELOG.md CHANGED
@@ -1,38 +1,56 @@
1
1
  # Change Log
2
2
 
3
- ## 5.14.2 (2025-08-01)
3
+ ## 5.14.4 (2025-08-13)
4
+
5
+ > [!WARNING]
6
+ > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
4
7
 
5
8
  ### Patch Changes
6
9
 
7
- - Fixed an issue where [`setLegalConsent()`][setLegalConsent] automatically triggered [`flush()`][flush], which could cause extra latency in serverless or edge environments (e.g., **Lambda@Edge**). It now requires an explicit `flush()`, giving developers full control over data submission.
10
+ - Fixed an issue where using [`getRemoteVisitorData`][getRemoteVisitorData] with `personalization=true` or [`evaluateAudiences`][evaluateAudiences] could cause a visitor’s targeting data to be unexpectedly removed from storage.
11
+
12
+ ## 5.14.3 (2025-08-12)
8
13
 
9
14
  > [!WARNING]
10
15
  > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
11
16
 
17
+ ### Patch Changes
18
+
19
+ - Fixed an issue where [`Cookie`](https://developers.kameleoon.com/feature-management-and-experimentation/web-sdks/js-sdk#cookie) would throw an exception when parsing from a string if the cookie value was empty.
20
+
21
+ ## 5.14.2 (2025-08-01)
22
+
23
+ > [!WARNING]
24
+ > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
25
+
26
+ ### Patch Changes
27
+
28
+ - Fixed an issue where [`setLegalConsent()`][setLegalConsent] automatically triggered [`flush()`][flush], which could cause extra latency in serverless or edge environments (e.g., **Lambda@Edge**). It now requires an explicit `flush()`, giving developers full control over data submission.
29
+
12
30
  ## 5.14.1 (2025-07-30)
13
31
 
32
+ > [!WARNING]
33
+ > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
34
+
14
35
  ### Patch Changes
15
36
 
16
37
  - Improved error logging when parsing [`defaultDataFile`](defaultDataFile) - now provides more informative messages for easier debugging.
17
38
  - Optimized tree-shaking to reduce bundle size by eliminating unused code.
18
39
  - Removed Node.js crypto dependency from the browser bundle to prevent build-time errors.
19
40
 
20
- > [!WARNING]
21
- > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
22
-
23
41
  [defaultDataFile]: https://developers.kameleoon.com/feature-management-and-experimentation/web-sdks/js-sdk/#configuration-parameters
24
42
 
25
43
  ## 5.14.0 (2025-07-24)
26
44
 
45
+ > [!WARNING]
46
+ > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
47
+
27
48
  ### Features
28
49
 
29
50
  - Migrated the build system for the NPM package from Babel (which previously generated multiple minified JS files) to Rollup, producing a single, optimized bundle.
30
51
  - Significantly reduced package size by consolidating files and improving tree-shaking.
31
52
  - Added native ESM support via modern Rollup outputs for better compatibility with modern bundlers.
32
53
 
33
- > [!WARNING]
34
- > If you're upgrading from a version earlier than 5.14.0 and run into any unexpected build or SDK-related issues, please reach out to the Kameleoon Support Team. We're here to ensure your transition is smooth and will promptly address any concerns.
35
-
36
54
  ## 5.13.0 (2025-07-23)
37
55
 
38
56
  ### Features
@@ -3417,21 +3417,23 @@ let Cookie$1 = class Cookie {
3417
3417
  /**
3418
3418
  * @method fromString - a static method for creating an instance of `Cookie` from a string
3419
3419
  * @param {string} cookieString - a string containing a list of cookies
3420
- * @throws {KameleoonError} throws an error if the string is not valid cookie
3421
3420
  * @returns {Cookie} an instance of `Cookie`
3422
3421
  * */
3423
3422
  static fromString(cookieString) {
3424
3423
  if (!cookieString) {
3425
- throw new KameleoonError(exports.KameleoonException.CookieParse, "Cookie string can't be empty");
3424
+ return new Cookie([]);
3426
3425
  }
3427
3426
  const pairs = cookieString.split(';');
3428
- const cookie = pairs.map((item) => {
3427
+ const cookie = pairs
3428
+ .map((item) => {
3429
3429
  const [key, value] = item.trim().split('=');
3430
- if (!key || !value) {
3431
- throw new KameleoonError(exports.KameleoonException.CookieParse, 'Cookie string is not valid');
3430
+ if (!key) {
3431
+ KameleoonLogger.warning `Cookie string has an empty key: ${cookieString}`;
3432
+ return null;
3432
3433
  }
3433
3434
  return { key, value };
3434
- });
3435
+ })
3436
+ .filter((item) => item !== null);
3435
3437
  return new Cookie(cookie);
3436
3438
  }
3437
3439
  get url() {
@@ -4430,6 +4432,9 @@ class SdkLanguage {
4430
4432
  if (!this.versionMatchType) {
4431
4433
  return buildExports.Ok(false);
4432
4434
  }
4435
+ if (sdkType !== this.sdkLanguage) {
4436
+ return buildExports.Ok(false);
4437
+ }
4433
4438
  const result = Utilities.compareSemVer({
4434
4439
  version,
4435
4440
  compareVersion: this.conditionValue,
@@ -4438,7 +4443,7 @@ class SdkLanguage {
4438
4443
  if (!result.ok) {
4439
4444
  return buildExports.Err(result.error);
4440
4445
  }
4441
- return buildExports.Ok(sdkType === this.sdkLanguage && result.data);
4446
+ return buildExports.Ok(result.data);
4442
4447
  }
4443
4448
  }
4444
4449
 
@@ -5266,6 +5271,8 @@ class IntegrityChecker {
5266
5271
  switch (key) {
5267
5272
  case exports.KameleoonData.PageView:
5268
5273
  case exports.KameleoonData.Conversion:
5274
+ case exports.KameleoonData.Personalization:
5275
+ case exports.KameleoonData.TargetedSegment:
5269
5276
  case exports.KameleoonData.CustomData: {
5270
5277
  const hasBadFields = Object.values(data).some((obj) => hasInvalidFields(obj));
5271
5278
  if (hasBadFields) {