diff --git a/CHANGELOG.md b/CHANGELOG.md index dca45cda..0686fcdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,49 @@ # Optimizely C# SDK Changelog +## 4.2.0 +Nov 13, 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, `decide` and related methods must be used. + +#### CMAB Configuration Options + +The following new configuration options have been added for CMAB: + +```csharp +using OptimizelySDK; + +// Configure CMAB settings before creating the Optimizely instance +var cmabConfig = new CmabConfig() + .SetCacheSize(1000) // Optional: Set CMAB cache size (default: 1000) + .SetCacheTtl(TimeSpan.FromMinutes(30)); // Optional: Set CMAB cache TTL (default: 30 minutes) + // .SetCache(customCache) // Optional: Custom cache implementation + +OptimizelyFactory.SetCmabConfig(cmabConfig); + +var optimizely = OptimizelyFactory.NewDefaultInstance("SDK_KEY_HERE"); +``` + +#### 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 + +```csharp +using OptimizelySDK.OptimizelyDecisions; + +// Example usage with CMAB decide options +var user = optimizely.CreateUserContext("user123"); +var decision = user.Decide("feature-flag-key", new[] +{ + OptimizelyDecideOption.IGNORE_CMAB_CACHE +}); +``` + ## 4.1.0 November 7th, 2024 diff --git a/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs b/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs index 147aa1a8..40772131 100644 --- a/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs @@ -37,6 +37,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/OptimizelySDK.Net35/Properties/AssemblyInfo.cs b/OptimizelySDK.Net35/Properties/AssemblyInfo.cs index dd5b9ab2..77c07883 100644 --- a/OptimizelySDK.Net35/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.Net35/Properties/AssemblyInfo.cs @@ -37,6 +37,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/OptimizelySDK.Net40/Properties/AssemblyInfo.cs b/OptimizelySDK.Net40/Properties/AssemblyInfo.cs index 48b0cb1d..368d2d5f 100644 --- a/OptimizelySDK.Net40/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.Net40/Properties/AssemblyInfo.cs @@ -37,6 +37,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs b/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs index f82a11ad..018b6364 100644 --- a/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs @@ -37,6 +37,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs b/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs index 72640cfa..9a9f2211 100644 --- a/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs @@ -37,6 +37,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/OptimizelySDK.Tests/Properties/AssemblyInfo.cs b/OptimizelySDK.Tests/Properties/AssemblyInfo.cs index f122893f..af81c50f 100644 --- a/OptimizelySDK.Tests/Properties/AssemblyInfo.cs +++ b/OptimizelySDK.Tests/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/OptimizelySDK/Properties/AssemblyInfo.cs b/OptimizelySDK/Properties/AssemblyInfo.cs index 96d04867..c06a0d5d 100644 --- a/OptimizelySDK/Properties/AssemblyInfo.cs +++ b/OptimizelySDK/Properties/AssemblyInfo.cs @@ -41,6 +41,6 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("4.1.0.0")] -[assembly: AssemblyFileVersion("4.1.0.0")] -[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet. +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] +[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet. diff --git a/README.md b/README.md index 9de4ddc7..9d21c7e4 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ User can provide variables using following procedure: ```
+ type="OptimizelySDK.OptimizelySDKConfigSection, OptimizelySDK, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null" /> ``` 2. Now add **optlySDKConfigSection** below ****. In this section you can add and set following **HttpProjectConfigManager** and **BatchEventProcessor** variables: