Skip to content

Commit d4fb403

Browse files
authored
[FSSDK-11965] prepare release 6.2.0 (#1098)
1 parent f2f4c10 commit d4fb403

File tree

9 files changed

+62
-10
lines changed

9 files changed

+62
-10
lines changed

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,57 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [6.2.0] - October 22, 2025
9+
10+
### New Features
11+
12+
- **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.
13+
14+
#### CMAB Configuration Options
15+
16+
The following new options have been added to configure the cmab cache:
17+
18+
```js
19+
import { createInstance } from '@optimizely/optimizely-sdk'
20+
21+
const optimizely = createInstance({
22+
// ... other config options
23+
cmab: {
24+
cacheSize: 1000, // Optional: Set CMAB cache size (default: 1000)
25+
cacheTtl: 30 * 60 * 1000, // Optional: Set CMAB cache TTL in milliseconds (default: 30 * 60 * 1000)
26+
cache: customCache // Optional: Custom cache implementation, instance of CacheWithRemove interface
27+
}
28+
});
29+
```
30+
31+
#### CMAB-Related OptimizelyDecideOptions
32+
33+
New decide options are available to control CMAB caching behavior:
34+
35+
- `OptimizelyDecideOption.IGNORE_CMAB_CACHE`: Bypass CMAB cache for fresh decisions
36+
- `OptimizelyDecideOption.RESET_CMAB_CACHE`: Clear and reset CMAB cache before making decisions
37+
- `OptimizelyDecideOption.INVALIDATE_USER_CMAB_CACHE`: Invalidate CMAB cache for the particular user and experiment
38+
39+
```js
40+
41+
// Example usage with CMAB decide options
42+
const decision = await userContext.decideAsync('feature-flag-key', [
43+
optimizelySdk.enums.OptimizelyDecideOption.IGNORE_CMAB_CACHE
44+
]);
45+
```
46+
47+
### Bug Fixes
48+
- 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))
49+
- Fixed typo in clientEngine option ([#1095](https://github.com/optimizely/javascript-sdk/pull/1095))
50+
51+
## [5.4.0] - Oct 13, 2025
52+
53+
### New Features
54+
- Added `customHeaders` option to `datafileOptions` for passing custom HTTP headers in datafile requests ([#1092](https://github.com/optimizely/javascript-sdk/pull/1092))
55+
### Bug Fixes
56+
- Fix the EventTags type to allow event properties ([#1040](https://github.com/optimizely/javascript-sdk/pull/1040))
57+
- Fix typo in event.experimentIds field in project config ([#1088](https://github.com/optimizely/javascript-sdk/pull/1088))
58+
859
## [6.1.0] - September 8, 2025
960

1061
### New Features

lib/export_types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export type {
6464
export type { ErrorHandler } from './error/error_handler';
6565
export type { OpaqueErrorNotifier } from './error/error_notifier_factory';
6666

67-
export type { Cache } from './utils/cache/cache';
68-
export type { Store } from './utils/cache/store'
67+
export type { SyncCache, AsyncCache, Cache, SyncCacheWithRemove, AsyncCacheWithRemove, CacheWithRemove } from './utils/cache/cache';
68+
export type { SyncStore, AsyncStore, Store } from './utils/cache/store'
6969

7070
export type {
7171
NotificationType,

lib/index.browser.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('javascript-sdk (Browser)', function() {
153153
});
154154

155155
assert.instanceOf(optlyInstance, Optimizely);
156-
assert.equal(optlyInstance.clientVersion, '6.1.0');
156+
assert.equal(optlyInstance.clientVersion, '6.2.0');
157157
});
158158

159159
it('should set the JavaScript client engine and version', function() {

lib/index.node.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ describe('optimizelyFactory', function() {
8888
});
8989

9090
assert.instanceOf(optlyInstance, Optimizely);
91-
assert.equal(optlyInstance.clientVersion, '6.1.0');
91+
assert.equal(optlyInstance.clientVersion, '6.2.0');
9292
});
9393
// TODO: user will create and inject an event processor
9494
// these tests will be refactored accordingly

lib/index.react_native.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('javascript-sdk/react-native', () => {
9292
expect(optlyInstance).toBeInstanceOf(Optimizely);
9393
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
9494
// @ts-ignore
95-
expect(optlyInstance.clientVersion).toEqual('6.1.0');
95+
expect(optlyInstance.clientVersion).toEqual('6.2.0');
9696
});
9797

9898
it('should set the React Native JS client engine and javascript SDK version', () => {

lib/index.universal.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export type {
9696
export type { ErrorHandler } from './error/error_handler';
9797
export type { OpaqueErrorNotifier } from './error/error_notifier_factory';
9898

99-
export type { Cache } from './utils/cache/cache';
99+
export type { SyncCache, AsyncCache, Cache, SyncCacheWithRemove, AsyncCacheWithRemove, CacheWithRemove } from './utils/cache/cache';
100+
export type { SyncStore, AsyncStore, Store } from './utils/cache/store'
100101

101102
export type {
102103
NotificationType,

lib/utils/enums/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const CONTROL_ATTRIBUTES = {
4141
export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
4242
export const NODE_CLIENT_ENGINE = 'node-sdk';
4343
export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk';
44-
export const CLIENT_VERSION = '6.1.0';
44+
export const CLIENT_VERSION = '6.2.0';
4545

4646
/*
4747
* Represents the source of a decision for feature management. When a feature

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@optimizely/optimizely-sdk",
3-
"version": "6.1.0",
3+
"version": "6.2.0",
44
"description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts",
55
"main": "./dist/index.node.min.js",
66
"browser": "./dist/index.browser.es.min.js",

0 commit comments

Comments
 (0)