@kameleoon/javascript-sdk-core 5.17.1 → 5.17.2
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 +6 -21
- package/dist/browser.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{javascript-sdk-core-browser.cjs.js → javascript-sdk-core.browser.cjs.js} +24 -27
- package/dist/javascript-sdk-core.browser.cjs.js.map +1 -0
- package/dist/{javascript-sdk-core-browser.es.js → javascript-sdk-core.browser.es.js} +15 -18
- package/dist/javascript-sdk-core.browser.es.js.map +1 -0
- package/dist/javascript-sdk-core.cjs.js +23 -26
- package/dist/javascript-sdk-core.cjs.js.map +1 -1
- package/dist/javascript-sdk-core.es.js +14 -17
- package/dist/javascript-sdk-core.es.js.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/package.json +3 -3
- package/dist/javascript-sdk-core-browser.cjs.js.map +0 -1
- package/dist/javascript-sdk-core-browser.es.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 5.17.2 (2026-01-21)
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Stability and performance improvements
|
|
8
|
+
|
|
3
9
|
## 5.17.1 (2025-12-24)
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -36,9 +42,6 @@
|
|
|
36
42
|
|
|
37
43
|
## 5.15.0 (2025-09-01)
|
|
38
44
|
|
|
39
|
-
> [!WARNING]
|
|
40
|
-
> 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.
|
|
41
|
-
|
|
42
45
|
### Features
|
|
43
46
|
|
|
44
47
|
- Added an `overwrite` flag to [`CustomData`](CustomData), used as the `overwrite` parameter during tracking.
|
|
@@ -46,45 +49,30 @@
|
|
|
46
49
|
|
|
47
50
|
## 5.14.5 (2025-08-20)
|
|
48
51
|
|
|
49
|
-
> [!WARNING]
|
|
50
|
-
> 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.
|
|
51
|
-
|
|
52
52
|
### Patch Changes
|
|
53
53
|
|
|
54
54
|
- Corrected the logic for sending tracking data to comply with GDPR requirements.
|
|
55
55
|
|
|
56
56
|
## 5.14.4 (2025-08-13)
|
|
57
57
|
|
|
58
|
-
> [!WARNING]
|
|
59
|
-
> 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.
|
|
60
|
-
|
|
61
58
|
### Patch Changes
|
|
62
59
|
|
|
63
60
|
- 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.
|
|
64
61
|
|
|
65
62
|
## 5.14.3 (2025-08-12)
|
|
66
63
|
|
|
67
|
-
> [!WARNING]
|
|
68
|
-
> 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.
|
|
69
|
-
|
|
70
64
|
### Patch Changes
|
|
71
65
|
|
|
72
66
|
- 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.
|
|
73
67
|
|
|
74
68
|
## 5.14.2 (2025-08-01)
|
|
75
69
|
|
|
76
|
-
> [!WARNING]
|
|
77
|
-
> 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.
|
|
78
|
-
|
|
79
70
|
### Patch Changes
|
|
80
71
|
|
|
81
72
|
- 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.
|
|
82
73
|
|
|
83
74
|
## 5.14.1 (2025-07-30)
|
|
84
75
|
|
|
85
|
-
> [!WARNING]
|
|
86
|
-
> 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.
|
|
87
|
-
|
|
88
76
|
### Patch Changes
|
|
89
77
|
|
|
90
78
|
- Improved error logging when parsing [`defaultDataFile`](defaultDataFile) - now provides more informative messages for easier debugging.
|
|
@@ -95,9 +83,6 @@
|
|
|
95
83
|
|
|
96
84
|
## 5.14.0 (2025-07-24)
|
|
97
85
|
|
|
98
|
-
> [!WARNING]
|
|
99
|
-
> 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.
|
|
100
|
-
|
|
101
86
|
### Features
|
|
102
87
|
|
|
103
88
|
- Migrated the build system for the NPM package from Babel (which previously generated multiple minified JS files) to Rollup, producing a single, optimized bundle.
|
package/dist/browser.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { IExternalEventSource, EventSourceOpenParametersType, } from './eventSou
|
|
|
18
18
|
export { Header, HeadersType, HttpMethod, IExternalRequester, RequestParametersType, RequestType, RetryCountType, KameleoonResponseType, SendRequestParametersType, NUMBER_OF_RETRIES, } from './requester';
|
|
19
19
|
export { ITracker } from './tracking';
|
|
20
20
|
export { SegmentType, TargetingDataType, Tree } from './targeting';
|
|
21
|
-
export { DataInfoType, IStorage, VISIT_DURATION, DataStorage } from './storage';
|
|
21
|
+
export { DataInfoType, IStorage, VISIT_DURATION, DataStorage, LegalConsent, } from './storage';
|
|
22
22
|
export { MappingIdentifierType } from './storage/types';
|
|
23
23
|
export { CustomDataConfigurationType, CustomDataScope, } from './clientConfiguration';
|
|
24
24
|
export { ListUtilities, Utilities } from './utilities';
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { IExternalEventSource, EventSourceOpenParametersType, } from './eventSou
|
|
|
18
18
|
export { Header, HeadersType, HttpMethod, IExternalRequester, RequestParametersType, RequestType, RetryCountType, KameleoonResponseType, SendRequestParametersType, NUMBER_OF_RETRIES, } from './requester';
|
|
19
19
|
export { ITracker } from './tracking';
|
|
20
20
|
export { SegmentType, TargetingDataType, Tree } from './targeting';
|
|
21
|
-
export { DataInfoType, IStorage, VISIT_DURATION, DataStorage } from './storage';
|
|
21
|
+
export { DataInfoType, IStorage, VISIT_DURATION, DataStorage, LegalConsent, } from './storage';
|
|
22
22
|
export { MappingIdentifierType } from './storage/types';
|
|
23
23
|
export { CustomDataConfigurationType, CustomDataScope, } from './clientConfiguration';
|
|
24
24
|
export { ListUtilities, Utilities } from './utilities';
|
|
@@ -3726,11 +3726,9 @@ class DataProcessor {
|
|
|
3726
3726
|
delete infoData.mappingIdentifiers[visitorCode];
|
|
3727
3727
|
}
|
|
3728
3728
|
}
|
|
3729
|
-
else
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
nextCleanupTime = closestCleanupTime;
|
|
3733
|
-
}
|
|
3729
|
+
else if (!nextCleanupTime ||
|
|
3730
|
+
(closestCleanupTime && closestCleanupTime < nextCleanupTime)) {
|
|
3731
|
+
nextCleanupTime = closestCleanupTime;
|
|
3734
3732
|
}
|
|
3735
3733
|
}
|
|
3736
3734
|
return nextCleanupTime;
|
|
@@ -3959,10 +3957,9 @@ class DataProcessor {
|
|
|
3959
3957
|
if (isExpired) {
|
|
3960
3958
|
delete existingData[nestedKey];
|
|
3961
3959
|
}
|
|
3962
|
-
else
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
}
|
|
3960
|
+
else if (!closestCleanupTime ||
|
|
3961
|
+
value.expirationTime < closestCleanupTime) {
|
|
3962
|
+
closestCleanupTime = value.expirationTime;
|
|
3966
3963
|
}
|
|
3967
3964
|
}
|
|
3968
3965
|
if (!Object.keys(existingData).length) {
|
|
@@ -5575,6 +5572,13 @@ class StorageCleanupManager {
|
|
|
5575
5572
|
}
|
|
5576
5573
|
}
|
|
5577
5574
|
|
|
5575
|
+
exports.LegalConsent = void 0;
|
|
5576
|
+
(function (LegalConsent) {
|
|
5577
|
+
LegalConsent[LegalConsent["Unknown"] = 0] = "Unknown";
|
|
5578
|
+
LegalConsent[LegalConsent["Given"] = 1] = "Given";
|
|
5579
|
+
LegalConsent[LegalConsent["NotGiven"] = 2] = "NotGiven";
|
|
5580
|
+
})(exports.LegalConsent || (exports.LegalConsent = {}));
|
|
5581
|
+
|
|
5578
5582
|
class TargetedSegment {
|
|
5579
5583
|
constructor(id) {
|
|
5580
5584
|
this.id = id;
|
|
@@ -7155,13 +7159,6 @@ class Hasher {
|
|
|
7155
7159
|
}
|
|
7156
7160
|
}
|
|
7157
7161
|
|
|
7158
|
-
var LegalConsent;
|
|
7159
|
-
(function (LegalConsent) {
|
|
7160
|
-
LegalConsent[LegalConsent["Unknown"] = 0] = "Unknown";
|
|
7161
|
-
LegalConsent[LegalConsent["Given"] = 1] = "Given";
|
|
7162
|
-
LegalConsent[LegalConsent["NotGiven"] = 2] = "NotGiven";
|
|
7163
|
-
})(LegalConsent || (LegalConsent = {}));
|
|
7164
|
-
|
|
7165
7162
|
class VariationConfiguration {
|
|
7166
7163
|
constructor(externalStorage, externalStorageForcedExperimentVariations, externalStorageForcedFeatureVariations, visitorCodeManager, clientConfiguration) {
|
|
7167
7164
|
this.storage = externalStorage;
|
|
@@ -7225,7 +7222,7 @@ class VariationConfiguration {
|
|
|
7225
7222
|
const { rules, featureKey, id: featureFlagId, defaultVariationKey, } = featureFlag;
|
|
7226
7223
|
const consent = clientConfiguration.isConsentRequired
|
|
7227
7224
|
? legalConsent
|
|
7228
|
-
: LegalConsent.Given;
|
|
7225
|
+
: exports.LegalConsent.Given;
|
|
7229
7226
|
for (const rule of rules) {
|
|
7230
7227
|
const { segment, experimentId, id, exposition, respoolTime, variationByExposition, } = rule;
|
|
7231
7228
|
const forcedVariationData = this.getForcedExperimentVariation(visitorCode, rule.experimentId);
|
|
@@ -7273,7 +7270,7 @@ class VariationConfiguration {
|
|
|
7273
7270
|
KameleoonLogger.debug `Calculated ruleHash: ${ruleHash} for code: ${visitorIdentifier}`;
|
|
7274
7271
|
if (ruleHash <= exposition) {
|
|
7275
7272
|
// Checking if the evaluation is blocked due to the consent policy
|
|
7276
|
-
if (consent == LegalConsent.NotGiven &&
|
|
7273
|
+
if (consent == exports.LegalConsent.NotGiven &&
|
|
7277
7274
|
rule.type == RuleType.EXPERIMENTATION) {
|
|
7278
7275
|
const behaviour = clientConfiguration.consentBlockingBehaviour;
|
|
7279
7276
|
if (behaviour == ConsentBlockingBehaviour.PartiallyBlocked) {
|
|
@@ -8802,7 +8799,7 @@ class KameleoonClient {
|
|
|
8802
8799
|
}
|
|
8803
8800
|
updateConsentData(visitorCode, consent) {
|
|
8804
8801
|
const readResult = this.consentDataStorage.read();
|
|
8805
|
-
const legalConsent = consent ? LegalConsent.Given : LegalConsent.NotGiven;
|
|
8802
|
+
const legalConsent = consent ? exports.LegalConsent.Given : exports.LegalConsent.NotGiven;
|
|
8806
8803
|
if (!readResult.ok) {
|
|
8807
8804
|
if (readResult.error.type === exports.KameleoonException.StorageEmpty) {
|
|
8808
8805
|
this.consentDataStorage.write({
|
|
@@ -8825,26 +8822,26 @@ class KameleoonClient {
|
|
|
8825
8822
|
const consentDataResult = this.consentDataStorage.read();
|
|
8826
8823
|
legalConsent = consentDataResult.ok
|
|
8827
8824
|
? this.extractLegalConsent(consentDataResult.data[visitorCode])
|
|
8828
|
-
: LegalConsent.Unknown;
|
|
8825
|
+
: exports.LegalConsent.Unknown;
|
|
8829
8826
|
KameleoonLogger.debug `RETURN: KameleoonClient.getLegalConsent(visitorCode: ${visitorCode}) -> (legalConsent: ${legalConsent})`;
|
|
8830
8827
|
return legalConsent;
|
|
8831
8828
|
}
|
|
8832
8829
|
extractLegalConsent(consentData) {
|
|
8833
8830
|
if (consentData === undefined)
|
|
8834
|
-
return LegalConsent.Unknown;
|
|
8831
|
+
return exports.LegalConsent.Unknown;
|
|
8835
8832
|
if (typeof consentData === 'boolean') {
|
|
8836
|
-
return consentData ? LegalConsent.Given : LegalConsent.NotGiven;
|
|
8833
|
+
return consentData ? exports.LegalConsent.Given : exports.LegalConsent.NotGiven;
|
|
8837
8834
|
}
|
|
8838
8835
|
const value = consentData.consent;
|
|
8839
8836
|
if (typeof value === 'boolean')
|
|
8840
|
-
return value ? LegalConsent.Given : LegalConsent.NotGiven;
|
|
8837
|
+
return value ? exports.LegalConsent.Given : exports.LegalConsent.NotGiven;
|
|
8841
8838
|
return value;
|
|
8842
8839
|
}
|
|
8843
8840
|
_isConsentProvided(visitorCode) {
|
|
8844
8841
|
KameleoonLogger.debug `CALL: KameleoonClient._isConsentProvided(visitorCode: ${visitorCode})`;
|
|
8845
8842
|
const { isConsentRequired } = this.clientConfiguration;
|
|
8846
8843
|
const isConsentProvided = !isConsentRequired ||
|
|
8847
|
-
this.getLegalConsent(visitorCode) == LegalConsent.Given;
|
|
8844
|
+
this.getLegalConsent(visitorCode) == exports.LegalConsent.Given;
|
|
8848
8845
|
KameleoonLogger.debug `RETURN: KameleoonClient._isConsentProvided(visitorCode: ${visitorCode}) -> (isConsentProvided: ${isConsentProvided})`;
|
|
8849
8846
|
return isConsentProvided;
|
|
8850
8847
|
}
|
|
@@ -9052,8 +9049,8 @@ class KameleoonClient {
|
|
|
9052
9049
|
// Checking if the evaluation is blocked due to the consent policy
|
|
9053
9050
|
const legalConsent = this.clientConfiguration.isConsentRequired
|
|
9054
9051
|
? this.getLegalConsent(visitorCode)
|
|
9055
|
-
: LegalConsent.Given;
|
|
9056
|
-
if (legalConsent == LegalConsent.NotGiven) {
|
|
9052
|
+
: exports.LegalConsent.Given;
|
|
9053
|
+
if (legalConsent == exports.LegalConsent.NotGiven) {
|
|
9057
9054
|
const behaviour = this.clientConfiguration.consentBlockingBehaviour;
|
|
9058
9055
|
if (behaviour == ConsentBlockingBehaviour.CompletelyBlocked) {
|
|
9059
9056
|
throw new KameleoonError(exports.KameleoonException.FeatureFlagEnvironmentDisabled, `Evaluation of holdout is blocked because consent is not provided for visitor '${visitorCode}'`);
|
|
@@ -9264,4 +9261,4 @@ exports.VISITOR_CODE_LENGTH = VISITOR_CODE_LENGTH;
|
|
|
9264
9261
|
exports.VISIT_DURATION = VISIT_DURATION;
|
|
9265
9262
|
exports.Validator = Validator;
|
|
9266
9263
|
exports.VisitorCodeManager = VisitorCodeManager;
|
|
9267
|
-
//# sourceMappingURL=javascript-sdk-core
|
|
9264
|
+
//# sourceMappingURL=javascript-sdk-core.browser.cjs.js.map
|