Skip to content

Release 6.2.0

Latest

Choose a tag to compare

@raju-opti raju-opti released this 23 Oct 15:48
3ae698b

[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, 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 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 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
    // 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)
  • Fixed typo in clientEngine option (#1095)