Releases: optimizely/javascript-sdk
Releases · optimizely/javascript-sdk
Release 6.2.0
[6.2.0] - October 23, 2025
New Features
-
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,
decideAsyncand related methods must be used. The syncdecidemethod does not support CMABs and will just skip CMAB rules while making decision for a flag.CMAB Configuration Options
The following new options have been added to configure the cmab cache:
import { createInstance } from '@optimizely/optimizely-sdk' const optimizely = createInstance({ // ... other config options 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 CacheWithRemove interface } });
CMAB-Related OptimizelyDecideOptions
New decide options are available to control CMAB caching behavior:
OptimizelyDecideOption.IGNORE_CMAB_CACHE: Bypass CMAB cache for fresh decisionsOptimizelyDecideOption.RESET_CMAB_CACHE: Clear and reset CMAB cache before making decisionsOptimizelyDecideOption.INVALIDATE_USER_CMAB_CACHE: Invalidate CMAB cache for the particular user and experiment
// Example usage with CMAB decide options const decision = await userContext.decideAsync('feature-flag-key', [ optimizelySdk.enums.OptimizelyDecideOption.IGNORE_CMAB_CACHE ]);
Bug Fixes
Release 5.4.0
Release 6.1.0
Release 6.0.0
[6.0.0] - May 29, 2025
Breaking Changes
- Modularized SDK architecture: The monolithic
createInstancecall has been split into multiple factory functions for greater flexibility and control. - Core functionalities (project configuration, event processing, ODP, VUID, logging, and error handling) are now configured through dedicated components created via factory functions, giving you greater flexibility and control in enabling/disabling certain components and allowing optimizing the bundle size for frontend projects.
onReadyPromise behavior changed: It now resolves only when the SDK is ready and rejects on initialization errors.- event processing is disabled by default and must be explicitly enabled by passing a
eventProcessorto the client. - Event dispatcher interface updated to use Promises instead of callbacks.
- Logging is disabled by default and must be explicitly enabled using a logger created via a factory function.
- VUID tracking is disabled by default and must be explicitly enabled by passing a
vuidManagerto the client instance. - ODP functionality is no longer enabled by default. You must explicitly pass an
odpManagerto enable it. - Dropped support for older browser versions and Node.js versions earlier than 18.0.0.
New Features
- Added support for async user profile service and async decide methods (see dcoumentation for User Profile Service and Decide methods)
Migration Guide
For detailed migration instructions, refer to the Migration Guide.
Documentation
For more details, see the official documentation: JavaScript SDK.
Release 5.3.5
Release 4.10.1
Release 5.3.4
Release 5.3.3
[5.3.3] - June 06, 2024
Changed
- queueMicroTask fallback addition for embedded environments / unsupported platforms (#933)
Release 5.3.2
Release 5.3.1
[5.3.1] - May 20, 2024
Changed
- Fix Memory Leak: Closed http request after getting response to release memory immediately (node) (#927)