From f6747d85935e3b6b9de96fe277ac26a913bb55c1 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 00:53:22 +0600 Subject: [PATCH 1/7] save --- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee82dd595..04522c432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,45 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.2.0] - October 21, 2025 + +### New Features + +- **Added support for Contextual Multi-Armed Bandit (CMAB)**: Added support for CMAB experiments(Contextaul Bandits rules) with new configuration options and cache control. To get decision from CMAB rules, `decideAsync` and related methods must be used. the sync `decide` method does not support CMABs and will just skip CMAB rules while making decision for a flag. + + **CMAB Configuration Options**: The following new options has been added to configure the cmab cache: + + ```js + import { createInstance } from '@optimizely/optimizely-sdk' + + const optimizely = createInstance({ + // ... other config options + cmab: { + cacheSize: 1000, // Optional: Set CMAB cache size (default: 1000) + cacheTtl: 300000, // Optional: Set CMAB cache TTL in milliseconds (default: 30 * 60 * 1000) + cache: customCache // Optional: Custom cache implementation, instance of CacheWithRemnove interface + } + }); + ``` + + **CMAB-Related OptimizelyDecideOptions**: New decide options are available to control CMAB caching behavior: + + - `OptimizelyDecideOption.IGNORE_CMAB_CACHE`: Bypass CMAB cache for fresh decisions + - `OptimizelyDecideOption.RESET_CMAB_CACHE`: Clear and reset CMAB cache before making decisions + - `OptimizelyDecideOption.INVALIDATE_USER_CMAB_CACHE`: Invalidate CMAB cache for the particular user and experiment + + ```js + // Example usage with CMAB decide options + const decision = await userContext.decideAsync('feature-flag-key', [ + optimizelySdk.enums.OptimizelyDecideOption.IGNORE_CMAB_CACHE + ]); + ``` + +### Bug Fixes +- Flush events without closing client on page unload which causes event processing to stop working when page is loaded from bfcache ([#1087](https://github.com/optimizely/javascript-sdk/pull/1087)) +- Fixed typo in clientEngine option ([#1095](https://github.com/optimizely/javascript-sdk/pull/1095)) + + ## [6.1.0] - September 8, 2025 ### New Features From 2def5ffd24de950cfda9ab925070f994db2754a6 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 00:57:04 +0600 Subject: [PATCH 2/7] save --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04522c432..55bf1ac11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - **Added support for Contextual Multi-Armed Bandit (CMAB)**: Added support for CMAB experiments(Contextaul Bandits rules) with new configuration options and cache control. To get decision from CMAB rules, `decideAsync` and related methods must be used. the sync `decide` method does not support CMABs and will just skip CMAB rules while making decision for a flag. - **CMAB Configuration Options**: The following new options has been added to configure the cmab cache: + #### CMAB Configuration Options + + The following new options has been added to configure the cmab cache: ```js import { createInstance } from '@optimizely/optimizely-sdk' @@ -26,7 +28,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. }); ``` - **CMAB-Related OptimizelyDecideOptions**: New decide options are available to control CMAB caching behavior: + #### CMAB-Related OptimizelyDecideOptions + + New decide options are available to control CMAB caching behavior: - `OptimizelyDecideOption.IGNORE_CMAB_CACHE`: Bypass CMAB cache for fresh decisions - `OptimizelyDecideOption.RESET_CMAB_CACHE`: Clear and reset CMAB cache before making decisions From a1b312b35f56b5024a206853498b64df3590becb Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 15:27:29 +0600 Subject: [PATCH 3/7] up --- CHANGELOG.md | 10 +++++++++- lib/index.browser.tests.js | 2 +- lib/index.node.tests.js | 2 +- lib/index.react_native.spec.ts | 2 +- lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55bf1ac11..c1f434b56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. // ... other config options cmab: { cacheSize: 1000, // Optional: Set CMAB cache size (default: 1000) - cacheTtl: 300000, // Optional: Set CMAB cache TTL in milliseconds (default: 30 * 60 * 1000) + cacheTtl: 30 * 60 * 1000, // Optional: Set CMAB cache TTL in milliseconds (default: 30 * 60 * 1000) cache: customCache // Optional: Custom cache implementation, instance of CacheWithRemnove interface } }); @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `OptimizelyDecideOption.INVALIDATE_USER_CMAB_CACHE`: Invalidate CMAB cache for the particular user and experiment ```js + // Example usage with CMAB decide options const decision = await userContext.decideAsync('feature-flag-key', [ optimizelySdk.enums.OptimizelyDecideOption.IGNORE_CMAB_CACHE @@ -47,6 +48,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Flush events without closing client on page unload which causes event processing to stop working when page is loaded from bfcache ([#1087](https://github.com/optimizely/javascript-sdk/pull/1087)) - Fixed typo in clientEngine option ([#1095](https://github.com/optimizely/javascript-sdk/pull/1095)) +## [5.4.0] - Oct 13, 2025 + +### New Features +- Added `customHeaders` option to `datafileOptions` for passing custom HTTP headers in datafile requests ([#1092](https://github.com/optimizely/javascript-sdk/pull/1092)) +### Bug Fixes +- Fix the EventTags type to allow event properties ([#1040](https://github.com/optimizely/javascript-sdk/pull/1040)) +- Fix typo in event.experimentIds field in project config ([#1088](https://github.com/optimizely/javascript-sdk/pull/1088)) ## [6.1.0] - September 8, 2025 diff --git a/lib/index.browser.tests.js b/lib/index.browser.tests.js index c12ed8ef8..645739cdb 100644 --- a/lib/index.browser.tests.js +++ b/lib/index.browser.tests.js @@ -153,7 +153,7 @@ describe('javascript-sdk (Browser)', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.1.0'); + assert.equal(optlyInstance.clientVersion, '6.2.0'); }); it('should set the JavaScript client engine and version', function() { diff --git a/lib/index.node.tests.js b/lib/index.node.tests.js index 343312174..b52a0f15c 100644 --- a/lib/index.node.tests.js +++ b/lib/index.node.tests.js @@ -88,7 +88,7 @@ describe('optimizelyFactory', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.1.0'); + assert.equal(optlyInstance.clientVersion, '6.2.0'); }); // TODO: user will create and inject an event processor // these tests will be refactored accordingly diff --git a/lib/index.react_native.spec.ts b/lib/index.react_native.spec.ts index 3fa5a6357..d8ed60bea 100644 --- a/lib/index.react_native.spec.ts +++ b/lib/index.react_native.spec.ts @@ -92,7 +92,7 @@ describe('javascript-sdk/react-native', () => { expect(optlyInstance).toBeInstanceOf(Optimizely); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - expect(optlyInstance.clientVersion).toEqual('6.1.0'); + expect(optlyInstance.clientVersion).toEqual('6.2.0'); }); it('should set the React Native JS client engine and javascript SDK version', () => { diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index fc95f2ef2..fd76d47ec 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -41,7 +41,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.1.0'; +export const CLIENT_VERSION = '6.2.0'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index 4820c783c..05ce4f677 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.1.0", + "version": "6.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.1.0", + "version": "6.2.0", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index 675bb7d4f..f094c577e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.1.0", + "version": "6.2.0", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", From ca5694be2b523491d58266d936993920a13ba811 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 16:43:10 +0600 Subject: [PATCH 4/7] up --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1f434b56..4d59e35e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [6.2.0] - October 21, 2025 +## [6.2.0] - October 22, 2025 ### New Features From 51c4b57ae69bf4416cd3316603db5fd4c56655b9 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 16:45:12 +0600 Subject: [PATCH 5/7] up --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d59e35e8..c411debc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### New Features -- **Added support for Contextual Multi-Armed Bandit (CMAB)**: Added support for CMAB experiments(Contextaul Bandits rules) with new configuration options and cache control. To get decision from CMAB rules, `decideAsync` and related methods must be used. the sync `decide` method does not support CMABs and will just skip CMAB rules while making decision for a flag. +- **Added support for Contextual Multi-Armed Bandit (CMAB)**: Added support for CMAB experiments(Contextual Bandits rules) with new configuration options and cache control. To get decision from CMAB rules, `decideAsync` and related methods must be used. The sync `decide` method does not support CMABs and will just skip CMAB rules while making decision for a flag. #### CMAB Configuration Options @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. cmab: { cacheSize: 1000, // Optional: Set CMAB cache size (default: 1000) cacheTtl: 30 * 60 * 1000, // Optional: Set CMAB cache TTL in milliseconds (default: 30 * 60 * 1000) - cache: customCache // Optional: Custom cache implementation, instance of CacheWithRemnove interface + cache: customCache // Optional: Custom cache implementation, instance of CacheWithRemove interface } }); ``` From e3de81f1deb22ed7a9b71c4261937d3005b27000 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 17:45:58 +0600 Subject: [PATCH 6/7] up --- lib/export_types.ts | 4 ++-- lib/index.universal.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/export_types.ts b/lib/export_types.ts index ce795dbaa..b620fbb8e 100644 --- a/lib/export_types.ts +++ b/lib/export_types.ts @@ -64,8 +64,8 @@ export type { export type { ErrorHandler } from './error/error_handler'; export type { OpaqueErrorNotifier } from './error/error_notifier_factory'; -export type { Cache } from './utils/cache/cache'; -export type { Store } from './utils/cache/store' +export type { SyncCache, AsyncCache, Cache, SyncCacheWithRemove, AsyncCacheWithRemove, CacheWithRemove } from './utils/cache/cache'; +export type { SyncStore, AsyncStore, Store } from './utils/cache/store' export type { NotificationType, diff --git a/lib/index.universal.ts b/lib/index.universal.ts index 9aaaa8cd3..11c39c1d1 100644 --- a/lib/index.universal.ts +++ b/lib/index.universal.ts @@ -96,7 +96,8 @@ export type { export type { ErrorHandler } from './error/error_handler'; export type { OpaqueErrorNotifier } from './error/error_notifier_factory'; -export type { Cache } from './utils/cache/cache'; +export type { SyncCache, AsyncCache, Cache, SyncCacheWithRemove, AsyncCacheWithRemove, CacheWithRemove } from './utils/cache/cache'; +export type { SyncStore, AsyncStore, Store } from './utils/cache/store' export type { NotificationType, From 9aac3741a4369b03bade095c4a5769a3ff26b08a Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 22 Oct 2025 18:30:22 +0600 Subject: [PATCH 7/7] nit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c411debc8..9a58beb95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. #### CMAB Configuration Options - The following new options has been added to configure the cmab cache: + The following new options have been added to configure the cmab cache: ```js import { createInstance } from '@optimizely/optimizely-sdk'