[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 ]);