Skip to content

Commit 552fe4f

Browse files
[FSSDK-11956] CMAB Release C# (#396)
1 parent c3d9b16 commit 552fe4f

File tree

9 files changed

+66
-22
lines changed

9 files changed

+66
-22
lines changed

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,49 @@
11
# Optimizely C# SDK Changelog
22

3+
## 4.2.0
4+
Nov 13, 2025
5+
6+
### New Features
7+
8+
- **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.
9+
10+
#### CMAB Configuration Options
11+
12+
The following new configuration options have been added for CMAB:
13+
14+
```csharp
15+
using OptimizelySDK;
16+
17+
// Configure CMAB settings before creating the Optimizely instance
18+
var cmabConfig = new CmabConfig()
19+
.SetCacheSize(1000) // Optional: Set CMAB cache size (default: 1000)
20+
.SetCacheTtl(TimeSpan.FromMinutes(30)); // Optional: Set CMAB cache TTL (default: 30 minutes)
21+
// .SetCache(customCache) // Optional: Custom cache implementation
22+
23+
OptimizelyFactory.SetCmabConfig(cmabConfig);
24+
25+
var optimizely = OptimizelyFactory.NewDefaultInstance("SDK_KEY_HERE");
26+
```
27+
28+
#### CMAB-Related OptimizelyDecideOptions
29+
30+
New decide options are available to control CMAB caching behavior:
31+
32+
- `OptimizelyDecideOption.IGNORE_CMAB_CACHE`: Bypass CMAB cache for fresh decisions
33+
- `OptimizelyDecideOption.RESET_CMAB_CACHE`: Clear and reset CMAB cache before making decisions
34+
- `OptimizelyDecideOption.INVALIDATE_USER_CMAB_CACHE`: Invalidate CMAB cache for the particular user and experiment
35+
36+
```csharp
37+
using OptimizelySDK.OptimizelyDecisions;
38+
39+
// Example usage with CMAB decide options
40+
var user = optimizely.CreateUserContext("user123");
41+
var decision = user.Decide("feature-flag-key", new[]
42+
{
43+
OptimizelyDecideOption.IGNORE_CMAB_CACHE
44+
});
45+
```
46+
347
## 4.1.0
448
November 7th, 2024
549

OptimizelySDK.DemoApp/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
//
3838
// You can specify all the values or you can default the Revision and Build Numbers
3939
// by using the '*' as shown below:
40-
[assembly: AssemblyVersion("4.1.0.0")]
41-
[assembly: AssemblyFileVersion("4.1.0.0")]
42-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
40+
[assembly: AssemblyVersion("4.2.0.0")]
41+
[assembly: AssemblyFileVersion("4.2.0.0")]
42+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

OptimizelySDK.Net35/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
//
3838
// You can specify all the values or you can default the Build and Revision Numbers
3939
// by using the '*' as shown below:
40-
[assembly: AssemblyVersion("4.1.0.0")]
41-
[assembly: AssemblyFileVersion("4.1.0.0")]
42-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
40+
[assembly: AssemblyVersion("4.2.0.0")]
41+
[assembly: AssemblyFileVersion("4.2.0.0")]
42+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

OptimizelySDK.Net40/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
//
3838
// You can specify all the values or you can default the Build and Revision Numbers
3939
// by using the '*' as shown below:
40-
[assembly: AssemblyVersion("4.1.0.0")]
41-
[assembly: AssemblyFileVersion("4.1.0.0")]
42-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
40+
[assembly: AssemblyVersion("4.2.0.0")]
41+
[assembly: AssemblyFileVersion("4.2.0.0")]
42+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
//
3838
// You can specify all the values or you can default the Build and Revision Numbers
3939
// by using the '*' as shown below:
40-
[assembly: AssemblyVersion("4.1.0")]
41-
[assembly: AssemblyFileVersion("4.1.0.0")]
42-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
40+
[assembly: AssemblyVersion("4.2.0")]
41+
[assembly: AssemblyFileVersion("4.2.0.0")]
42+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
//
3838
// You can specify all the values or you can default the Build and Revision Numbers
3939
// by using the '*' as shown below:
40-
[assembly: AssemblyVersion("4.1.0.0")]
41-
[assembly: AssemblyFileVersion("4.1.0.0")]
42-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
40+
[assembly: AssemblyVersion("4.2.0.0")]
41+
[assembly: AssemblyFileVersion("4.2.0.0")]
42+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

OptimizelySDK.Tests/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
//
3131
// You can specify all the values or you can default the Revision and Build Numbers
3232
// by using the '*' as shown below:
33-
[assembly: AssemblyVersion("4.1.0.0")]
34-
[assembly: AssemblyFileVersion("4.1.0.0")]
35-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
33+
[assembly: AssemblyVersion("4.2.0.0")]
34+
[assembly: AssemblyFileVersion("4.2.0.0")]
35+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

OptimizelySDK/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
//
4242
// You can specify all the values or you can default the Build and Revision Numbers
4343
// by using the '*' as shown below:
44-
[assembly: AssemblyVersion("4.1.0.0")]
45-
[assembly: AssemblyFileVersion("4.1.0.0")]
46-
[assembly: AssemblyInformationalVersion("4.1.0")] // Used by NuGet.
44+
[assembly: AssemblyVersion("4.2.0.0")]
45+
[assembly: AssemblyFileVersion("4.2.0.0")]
46+
[assembly: AssemblyInformationalVersion("4.2.0")] // Used by NuGet.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ User can provide variables using following procedure:
104104
```
105105
<configSections>
106106
<section name="optlySDKConfigSection"
107-
type="OptimizelySDK.OptimizelySDKConfigSection, OptimizelySDK, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" />
107+
type="OptimizelySDK.OptimizelySDKConfigSection, OptimizelySDK, Version=4.2.0.0, Culture=neutral, PublicKeyToken=null" />
108108
</configSections>
109109
```
110110
2. Now add **optlySDKConfigSection** below **<configSections>**. In this section you can add and set following **HttpProjectConfigManager** and **BatchEventProcessor** variables:

0 commit comments

Comments
 (0)