diff --git a/content/en/feature_flags/_index.md b/content/en/feature_flags/_index.md
index cae0159b609..07f78ec2a1d 100644
--- a/content/en/feature_flags/_index.md
+++ b/content/en/feature_flags/_index.md
@@ -27,7 +27,31 @@ further_reading:
## Overview
-Feature flags enable you to toggle features on and off, conduct A/B/n testing, gradually roll out new functionality, and personalize user experiences—all without the need for extensive code deployments. With feature flags, you can empower your team to make dynamic changes, iterate rapidly, and deliver enhanced user experiences.
+Datadog Feature Flags is Datadog's flag management product. You create flags in Datadog, deliver flag configuration to Datadog Feature Flags SDKs, and evaluate variants in your application through Datadog or OpenFeature APIs.
+
+Datadog Feature Flags is built on the [OpenFeature standard](https://openfeature.dev/docs/reference/intro/), an open-source, vendor-neutral specification for feature flag APIs. See OpenFeature's getting-started guide if you're new to OpenFeature concepts like providers, evaluation context, and hooks.
+
+Feature flags enable you to toggle features on and off, conduct A/B/n testing, gradually roll out new functionality, and personalize user experiences without the need for extensive code deployments. With feature flags, you can empower your team to make dynamic changes, iterate rapidly, and deliver enhanced user experiences.
+
+If your flags are managed by LaunchDarkly, Split, ConfigCat, or another provider and you only want Datadog to record evaluated variants in RUM, see [RUM Feature Flag Tracking](/real_user_monitoring/feature_flag_tracking/) instead.
+
+Use a client-side SDK when the flag must be evaluated in a browser, mobile app, or game client. Use a server-side SDK when the decision should happen in a backend service and the flag configuration can be delivered through the Datadog Agent and Remote Configuration.
+
+### Credentials at a glance
+
+| Credential | Used by | Where it goes | Sensitive? |
+| --- | --- | --- | --- |
+| Client token | Browser, mobile, and game SDKs | Client application configuration | Public-shipping token |
+| Application ID | Browser and RUM-backed client SDKs | Client application configuration | Public-shipping identifier |
+| API key | Datadog Agent for server-side Remote Configuration | Agent configuration only | Secret |
+
+Do not put API keys in browser, mobile, or game applications.
+
+### Evaluation context and telemetry
+
+Evaluation context attributes are the flat string, number, and Boolean values that Datadog uses for targeting rules and rollout bucketing. Set a stable `targetingKey`, such as a user ID, session ID, or device ID, so percentage rollouts are consistent.
+
+Feature Flags telemetry includes exposure events, flag evaluation metrics, and optional RUM correlation depending on the SDK and configuration.
## Further reading
diff --git a/content/en/feature_flags/client/_index.md b/content/en/feature_flags/client/_index.md
index 222a36bd8f4..a1e25c8317b 100644
--- a/content/en/feature_flags/client/_index.md
+++ b/content/en/feature_flags/client/_index.md
@@ -19,8 +19,22 @@ further_reading:
Set up Datadog Feature Flags for your applications. Follow the platform-specific guides below to integrate feature flags into your application and start collecting feature flag data:
+Datadog Feature Flags is built on the [OpenFeature standard](https://openfeature.dev/docs/reference/intro/), an open-source, vendor-neutral specification for feature flag APIs. See OpenFeature's getting-started guide if you're new to OpenFeature concepts like providers, evaluation context, and hooks.
+
{{< partial name="feature_flags/feature_flags_client.html" >}}
+## Telemetry options by platform
+
+The web, mobile, and Unity providers expose similar telemetry controls with platform-specific option names. When a telemetry option is exposed, its default value is `true`.
+
+| Concept | Web (`@datadog/openfeature-browser`) | Android (`dd-sdk-android-flags`) | iOS (`DatadogFlags`) | React Native | Unity |
+|---|---|---|---|---|---|
+| Send exposure events | `enableExposureLogging` | `trackExposures` | `trackExposures` | `trackExposures` | `trackExposures` |
+| Send aggregated evaluation telemetry | `enableFlagEvaluationTracking` | `trackEvaluations` | `trackEvaluations` | Not exposed | `trackEvaluations` |
+| Attach evaluations to RUM | `enableRumFeatureFlagTracking` | `rumIntegrationEnabled` | `rumIntegrationEnabled` | `rumIntegrationEnabled` | Not exposed |
+
+
The iOS OpenFeature bridge (
dd-openfeature-provider-swift) is currently in development. For production iOS workloads, use the
FlagsClient API directly.
+
## Testing with in-memory providers
Datadog supports these testing approaches:
diff --git a/content/en/feature_flags/client/android.md b/content/en/feature_flags/client/android.md
index 905fb653352..9463b7601aa 100644
--- a/content/en/feature_flags/client/android.md
+++ b/content/en/feature_flags/client/android.md
@@ -30,7 +30,7 @@ Here's a minimal example to get feature flags working in your Android app:
```kotlin
// 1. Add dependencies (see Installation section)
-// 2. Initialize Datadog SDK (in Application.onCreate)
+// 2. Initialize the Datadog Android SDK (in Application.onCreate)
val configuration = Configuration.Builder(
clientToken = "",
env = "",
@@ -94,7 +94,7 @@ Datadog.initialize(this, configuration, TrackingConsent.GRANTED)
## Enable flags
-After initializing Datadog, enable `Flags` to attach it to the current Datadog SDK instance and prepare for provider creation and flag evaluation:
+After initializing Datadog, enable `Flags` to attach it to the current Datadog Android SDK instance and prepare for provider creation and flag evaluation:
{{< code-block lang="kotlin" >}}
import com.datadog.android.flags.Flags
@@ -128,6 +128,8 @@ OpenFeatureAPI.setProviderAndWait(provider)
Define who or what the flag evaluation applies to using an `ImmutableContext`. The evaluation context includes user or session information used to determine which flag variations should be returned. Set this before evaluating flags to help ensure proper targeting.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="kotlin" >}}
import dev.openfeature.kotlin.sdk.ImmutableContext
import dev.openfeature.kotlin.sdk.Value
@@ -143,7 +145,7 @@ OpenFeatureAPI.setEvaluationContext(
)
{{< /code-block >}}
-All attribute values must use a Value.String() wrapper. The targeting key should be consistent for the same user to help ensure consistent flag evaluation across sessions. For anonymous users, use a persistent UUID stored, for example, in SharedPreferences.
+OpenFeature attributes must use flat Value primitives such as Value.String(), Value.Integer(), Value.Double(), or Value.Boolean(). The targeting key should be consistent for the same user to help ensure consistent flag evaluation across sessions. For anonymous users, use a persistent UUID stored, for example, in SharedPreferences.
## Evaluate flags
@@ -288,6 +290,7 @@ You can configure individual providers with custom endpoints before creating the
val provider = FlagsClient.Builder()
.useCustomFlagEndpoint("https://your-proxy.example.com/flags")
.useCustomExposureEndpoint("https://your-proxy.example.com/exposure")
+ .useCustomEvaluationEndpoint("https://your-proxy.example.com/evaluations")
.build()
.asOpenFeatureProvider()
diff --git a/content/en/feature_flags/client/angular.md b/content/en/feature_flags/client/angular.md
index 21eef6d1027..215ef3e78c2 100644
--- a/content/en/feature_flags/client/angular.md
+++ b/content/en/feature_flags/client/angular.md
@@ -50,12 +50,15 @@ pnpm add @datadog/openfeature-browser @openfeature/angular-sdk @openfeature/web-
## Initialize the provider
-Create a `DatadogProvider` instance with your Datadog credentials. To create a client token, see [Client tokens][2].
+Create a `DatadogProvider` instance with your Datadog credentials. `applicationId`, `clientToken`, `site`, and `env` are required. To create a client token, see [Client tokens][2].
+
+Note: Browser Feature Flags are currently not supported on GovCloud sites.
```typescript
import { DatadogProvider } from '@datadog/openfeature-browser';
const provider = new DatadogProvider({
+ // Required client-side Datadog credentials
applicationId: '',
clientToken: '',
site: '{{< region-param key="dd_site" code="true" >}}',
@@ -71,6 +74,8 @@ Import the `OpenFeatureModule` in your Angular module and configure it using the
Define who or what the flag evaluation applies to using an evaluation context. The evaluation context includes user or session information used to determine which flag variations should be returned. Reference these attributes in your targeting rules to control who sees each variant.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
The targetingKey is used as the randomization subject for percentage-based targeting. When a flag targets a percentage of subjects (for example, 50%), the targetingKey determines which "bucket" a user falls into. Users with the same targetingKey always receive the same variant for a given flag.
### Using a static object
@@ -489,10 +494,67 @@ export class MyComponent {
}
{{< /code-block >}}
+## Configure browser provider options
+
+The Angular provider uses the Datadog browser provider, which also supports these optional settings:
+
+| Option | Default | Use |
+| --- | --- | --- |
+| `enableExposureLogging` | `true` | Send exposure events to the exposures intake. |
+| `enableFlagEvaluationTracking` | `true` | Send aggregated evaluation telemetry. |
+| `enableRumFeatureFlagTracking` | `true` | Add flag evaluations to RUM events. This is the setting that can affect RUM usage. |
+| `flagEvaluationTrackingInterval` | `10000` ms | Flush interval for evaluation telemetry. |
+| `initialFlagsConfiguration` | `{}` | Bootstrap with precomputed flags. |
+| `flaggingProxy` | unset | Fetch flags through a proxy instead of `site`. |
+| `customHeaders` | unset | Add headers to flag-fetch requests. |
+| `overwriteRequestHeaders` | `false` | Replace default request headers with `customHeaders`. |
+
+## Testing
+
+You can test against a dedicated Datadog test environment with the real `DatadogProvider`, or swap it for OpenFeature's `TypedInMemoryProvider` to control flag values directly in test code. This section shows the in-memory approach, which keeps tests hermetic and offline. `TypedInMemoryProvider` is exported from `@openfeature/web-sdk`, which is already installed for Angular Feature Flags.
+
+{{< code-block lang="typescript" >}}
+import { TestBed } from '@angular/core/testing';
+import { firstValueFrom } from 'rxjs';
+import { FeatureFlagService, OpenFeatureModule } from '@openfeature/angular-sdk';
+import { TypedInMemoryProvider } from '@openfeature/web-sdk';
+
+const flags = {
+ new_checkout_button: {
+ variants: { on: true, off: false },
+ defaultVariant: 'on',
+ disabled: false,
+ },
+};
+
+beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [
+ OpenFeatureModule.forRoot({
+ provider: new TypedInMemoryProvider(flags),
+ context: { targetingKey: 'test-user' },
+ }),
+ ],
+ }).compileComponents();
+});
+
+afterEach(() => {
+ TestBed.resetTestingModule();
+});
+
+it('uses in-memory flag values', async () => {
+ const flagService = TestBed.inject(FeatureFlagService);
+ const details = await firstValueFrom(flagService.getBooleanDetails('new_checkout_button', false));
+
+ expect(details.value).toBe(true);
+});
+{{< /code-block >}}
+
+The Web SDK flag shape requires `variants`, `defaultVariant`, and `disabled`. Register the in-memory provider before injecting services or rendering components that read flags.
+
## Further reading
{{< partial name="whats-next/whats-next.html" >}}
[1]: https://openfeature.dev/docs/reference/sdks/client/web/angular/
[2]: /account_management/api-app-keys/#client-tokens
-
diff --git a/content/en/feature_flags/client/ios.md b/content/en/feature_flags/client/ios.md
index 0b66c420831..997de415cee 100644
--- a/content/en/feature_flags/client/ios.md
+++ b/content/en/feature_flags/client/ios.md
@@ -94,7 +94,7 @@ Datadog.initialize(
## Enable flags
-After initializing Datadog, enable `Flags` to attach it to the current Datadog SDK instance and prepare for client creation and flags evaluation:
+After initializing Datadog, enable `Flags` to attach it to the current Datadog iOS SDK instance and prepare for client creation and flags evaluation:
{{< code-block lang="swift" >}}
import DatadogFlags
@@ -131,6 +131,8 @@ let flagsClient = FlagsClient.shared(named: "checkout")
Define who or what the flag evaluation applies to using a `FlagsEvaluationContext`. The evaluation context includes user or session information used to determine which flag variations should be returned. Call this method before evaluating flags to ensure proper targeting.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="swift" >}}
flagsClient.setEvaluationContext(
FlagsEvaluationContext(
@@ -240,7 +242,7 @@ When you need more than just the flag value, use the `getDetails` APIs. Th
For example:
{{< code-block lang="swift" >}}
-let details = flags.getStringDetails(
+let details = flagsClient.getStringDetails(
key: "paywall.layout",
defaultValue: "control"
)
@@ -387,12 +389,15 @@ Flags.enable(with: config)
`customExposureEndpoint`
: Configures a custom server URL for sending flags exposure data.
+`customEvaluationEndpoint`
+: Configures a custom server URL for sending flag evaluation telemetry.
+
`customFlagsHeaders`
: Sets additional HTTP headers to attach to requests made to `customFlagsEndpoint`. It can be useful for authentication or routing when using your own flags service.
## Testing
-The examples above use Datadog's `FlagsClient` API directly. If you prefer to drive feature flags through the [OpenFeature](https://openfeature.dev/) standard API, Datadog ships an OpenFeature bridge for iOS at [dd-openfeature-provider-swift](https://github.com/DataDog/dd-openfeature-provider-swift). Use the bridge's `DatadogProvider` in production, and for code-controlled flag values in tests, substitute an in-memory provider.
+The examples above use Datadog's `FlagsClient` API directly. Use `FlagsClient` for production workloads. If you are prototyping against the [OpenFeature](https://openfeature.dev/) bridge or writing tests around the OpenFeature API, substitute an in-memory provider for code-controlled flag values.
You can test against a dedicated Datadog test environment with the real `DatadogProvider`, or swap it for an in-memory `FeatureProvider` to control flag values directly in test code. This section shows the in-memory approach, which keeps tests hermetic and offline. The OpenFeature Swift SDK does not ship an `InMemoryProvider`, so tests use a small custom `FeatureProvider` instead.
diff --git a/content/en/feature_flags/client/javascript.md b/content/en/feature_flags/client/javascript.md
index b9e87676cab..cc3ed5035f8 100644
--- a/content/en/feature_flags/client/javascript.md
+++ b/content/en/feature_flags/client/javascript.md
@@ -45,13 +45,16 @@ pnpm add @datadog/openfeature-browser @openfeature/web-sdk @openfeature/core
## Initialize the provider
-Create a `DatadogProvider` instance with your Datadog credentials. To create a client token, see [Client tokens][2].
+Create a `DatadogProvider` instance with your Datadog credentials. `applicationId`, `clientToken`, `site`, and `env` are required. To create a client token, see [Client tokens][2].
+
+Note: Browser Feature Flags are currently not supported on GovCloud sites.
```javascript
import { DatadogProvider } from '@datadog/openfeature-browser';
import { OpenFeature } from '@openfeature/web-sdk';
const provider = new DatadogProvider({
+ // Required client-side Datadog credentials
applicationId: '',
clientToken: '',
site: '{{< region-param key="dd_site" code="true" >}}',
@@ -63,6 +66,8 @@ const provider = new DatadogProvider({
Define who or what the flag evaluation applies to using an evaluation context. The evaluation context includes user or session information used to determine which flag variations should be returned. Reference these attributes in your targeting rules to control who sees each variant.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="javascript" >}}
const evaluationContext = {
targetingKey: 'user-123',
@@ -199,6 +204,21 @@ await OpenFeature.setContext({
});
{{< /code-block >}}
+## Configure browser provider options
+
+The web provider also supports these optional settings:
+
+| Option | Default | Use |
+| --- | --- | --- |
+| `enableExposureLogging` | `true` | Send exposure events to the exposures intake. |
+| `enableFlagEvaluationTracking` | `true` | Send aggregated evaluation telemetry. |
+| `enableRumFeatureFlagTracking` | `true` | Add flag evaluations to RUM events. This is the setting that can affect RUM usage. |
+| `flagEvaluationTrackingInterval` | `10000` ms | Flush interval for evaluation telemetry. |
+| `initialFlagsConfiguration` | `{}` | Bootstrap with precomputed flags. |
+| `flaggingProxy` | unset | Fetch flags through a proxy instead of `site`. |
+| `customHeaders` | unset | Add headers to flag-fetch requests. |
+| `overwriteRequestHeaders` | `false` | Replace default request headers with `customHeaders`. |
+
## Testing
You can test against a dedicated Datadog test environment with the real `DatadogProvider`, or swap it for OpenFeature's `InMemoryProvider` to control flag values directly in test code. This section shows the in-memory approach, which keeps tests hermetic and offline. `InMemoryProvider` is exported directly from `@openfeature/web-sdk`, so no additional dependency is required.
@@ -249,4 +269,3 @@ The Web SDK flag shape requires `variants`, `defaultVariant`, and `disabled`. Om
[1]: https://openfeature.dev/
[2]: /account_management/api-app-keys/#client-tokens
-
diff --git a/content/en/feature_flags/client/react.md b/content/en/feature_flags/client/react.md
index 34fefa6c19e..5dd4b5b08ed 100644
--- a/content/en/feature_flags/client/react.md
+++ b/content/en/feature_flags/client/react.md
@@ -26,31 +26,34 @@ Install the Datadog OpenFeature provider and the OpenFeature React SDK using you
{{< tabs >}}
{{% tab "npm" %}}
{{< code-block lang="bash" >}}
-npm install @datadog/openfeature-browser @openfeature/react-sdk @openfeature/core
+npm install @datadog/openfeature-browser @openfeature/react-sdk @openfeature/web-sdk @openfeature/core
{{< /code-block >}}
{{% /tab %}}
{{% tab "yarn" %}}
{{< code-block lang="bash" >}}
-yarn add @datadog/openfeature-browser @openfeature/react-sdk @openfeature/core
+yarn add @datadog/openfeature-browser @openfeature/react-sdk @openfeature/web-sdk @openfeature/core
{{< /code-block >}}
{{% /tab %}}
{{% tab "pnpm" %}}
{{< code-block lang="bash" >}}
-pnpm add @datadog/openfeature-browser @openfeature/react-sdk @openfeature/core
+pnpm add @datadog/openfeature-browser @openfeature/react-sdk @openfeature/web-sdk @openfeature/core
{{< /code-block >}}
{{% /tab %}}
{{< /tabs >}}
## Initialize the provider
-Create a `DatadogProvider` instance and register it with OpenFeature. Do this as early as possible in your application, before rendering your React components. To create a client token, see [Client tokens][2].
+Create a `DatadogProvider` instance and register it with OpenFeature. Do this as early as possible in your application, before rendering your React components. `applicationId`, `clientToken`, `site`, and `env` are required. To create a client token, see [Client tokens][2].
+
+Note: Browser Feature Flags are currently not supported on GovCloud sites.
```javascript
import { DatadogProvider } from '@datadog/openfeature-browser';
const provider = new DatadogProvider({
+ // Required client-side Datadog credentials
applicationId: '',
clientToken: '',
site: '{{< region-param key="dd_site" code="true" >}}',
@@ -62,6 +65,8 @@ const provider = new DatadogProvider({
Define who or what the flag evaluation applies to using an evaluation context. The evaluation context includes user or session information used to determine which flag variations should be returned. Reference these attributes in your targeting rules to control who sees each variant.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
Set the provider along with the evaluation context:
{{< code-block lang="javascript" >}}
@@ -178,7 +183,6 @@ For example:
import { useBooleanFlag } from '@openfeature/react-sdk';
import { Suspense } from 'react';
-import
function Content() {
// Display a loading message if the component uses feature flags and the provider is not ready
return (
@@ -293,6 +297,21 @@ await OpenFeature.setContext({
});
{{< /code-block >}}
+## Configure browser provider options
+
+The React provider uses the Datadog browser provider, which also supports these optional settings:
+
+| Option | Default | Use |
+| --- | --- | --- |
+| `enableExposureLogging` | `true` | Send exposure events to the exposures intake. |
+| `enableFlagEvaluationTracking` | `true` | Send aggregated evaluation telemetry. |
+| `enableRumFeatureFlagTracking` | `true` | Add flag evaluations to RUM events. This is the setting that can affect RUM usage. |
+| `flagEvaluationTrackingInterval` | `10000` ms | Flush interval for evaluation telemetry. |
+| `initialFlagsConfiguration` | `{}` | Bootstrap with precomputed flags. |
+| `flaggingProxy` | unset | Fetch flags through a proxy instead of `site`. |
+| `customHeaders` | unset | Add headers to flag-fetch requests. |
+| `overwriteRequestHeaders` | `false` | Replace default request headers with `customHeaders`. |
+
## Testing
You can test against a dedicated Datadog test environment with the real `DatadogProvider`, or swap it for OpenFeature's `TypedInMemoryProvider` to control flag values directly in test code. This section shows the in-memory approach, which keeps tests hermetic and offline. `TypedInMemoryProvider` is exported from `@openfeature/web-sdk`; install it as a development dependency and register it before rendering components under test:
diff --git a/content/en/feature_flags/client/reactnative.md b/content/en/feature_flags/client/reactnative.md
index be9b2e56025..55d9dd1d643 100644
--- a/content/en/feature_flags/client/reactnative.md
+++ b/content/en/feature_flags/client/reactnative.md
@@ -68,7 +68,7 @@ buildscript {
## Initialize the SDK
-The Datadog OpenFeature provider for React Native requires the core Datadog SDK to be initialized first, followed by enabling the Feature Flags feature. To create a client token, see [Client tokens][2].
+The Datadog OpenFeature provider for React Native requires the core Datadog React Native SDK to be initialized first, followed by enabling the Feature Flags feature. To create a client token, see [Client tokens][2].
### Option 1: Using DatadogProvider component
@@ -269,7 +269,7 @@ function Content() {
}
function WelcomeMessage() {
- const { value: showNewMessage } = useBooleanFlagValue('show-new-welcome-message', false, { suspend: true });
+ const showNewMessage = useBooleanFlagValue('show-new-welcome-message', false, { suspend: true });
return (
<>
@@ -439,13 +439,57 @@ OpenFeature.setContext({
});
{{< /code-block >}}
+## Testing
+
+You can test against a dedicated Datadog test environment with the real `DatadogOpenFeatureProvider`, or swap it for OpenFeature's `TypedInMemoryProvider` to control flag values directly in test code. This section shows the in-memory approach, which keeps tests hermetic and offline. `TypedInMemoryProvider` is exported from `@openfeature/web-sdk`, which is already installed for React Native Feature Flags.
+
+{{< code-block lang="tsx" >}}
+import { render, screen } from '@testing-library/react-native';
+import { Text } from 'react-native';
+import { OpenFeature, OpenFeatureProvider, useBooleanFlagValue } from '@openfeature/react-sdk';
+import { TypedInMemoryProvider } from '@openfeature/web-sdk';
+
+const flags = {
+ new_checkout_button: {
+ variants: { on: true, off: false },
+ defaultVariant: 'on',
+ disabled: false,
+ },
+};
+
+beforeEach(async () => {
+ await OpenFeature.setProviderAndWait(new TypedInMemoryProvider(flags));
+});
+
+afterAll(async () => {
+ await OpenFeature.close();
+});
+
+function CheckoutButton() {
+ const enabled = useBooleanFlagValue('new_checkout_button', false);
+ return {enabled ? 'New checkout' : 'Legacy checkout'};
+}
+
+test('new checkout button is enabled', () => {
+ render(
+
+
+
+ );
+
+ expect(screen.getByText('New checkout')).toBeTruthy();
+});
+{{< /code-block >}}
+
+The Web SDK flag shape requires `variants`, `defaultVariant`, and `disabled`. Use `setProviderAndWait` before rendering components so hooks do not evaluate against the default provider.
+
## Troubleshooting
### No flags returned
If flag evaluations return default values:
-1. Verify the Datadog SDK is initialized before calling `DdFlags.enable()`.
+1. Verify the Datadog React Native SDK is initialized before calling `DdFlags.enable()`.
2. Confirm `DdFlags.enable()` completed before setting the OpenFeature provider.
3. Check that the evaluation context is set before evaluating flags.
4. Confirm the flag exists and is enabled in your Datadog Feature Flags dashboard.
@@ -475,7 +519,7 @@ end
If you see an error about Feature Flags not being initialized, verify the initialization order:
-1. Initialize the core Datadog SDK first (`DdSdkReactNative.initialize()` or `DatadogProvider`).
+1. Initialize the core Datadog React Native SDK first (`DdSdkReactNative.initialize()` or `DatadogProvider`).
2. Call `DdFlags.enable()` after SDK initialization.
3. Create and set the `DatadogOpenFeatureProvider` after enabling flags.
diff --git a/content/en/feature_flags/client/unity.md b/content/en/feature_flags/client/unity.md
index e0d8d1c067b..a362feb38bf 100644
--- a/content/en/feature_flags/client/unity.md
+++ b/content/en/feature_flags/client/unity.md
@@ -25,7 +25,7 @@ Declare the Datadog Unity SDK as a dependency in your project. The Datadog Unity
1. Install the [External Dependency Manager for Unity (EDM4U)][1]. This can be done using [Open UPM][2].
-2. Add the [Datadog SDK Unity package][3] using its Git URL `https://github.com/DataDog/unity-package.git`.
+2. Add the [Datadog Unity SDK package][3] using its Git URL `https://github.com/DataDog/unity-package.git`.
3. (Android only) Configure your project to use [Gradle templates][4], and enable both `Custom Main Template` and `Custom Gradle Properties Template`.
@@ -47,7 +47,7 @@ For more information about setting up the Unity SDK, see [Unity Monitoring Setup
## Enable flags
-After initializing Datadog, enable `Flags` to attach it to the current Datadog SDK instance and prepare for client creation and flag evaluation:
+After initializing Datadog, enable `Flags` to attach it to the current Datadog Unity SDK instance and prepare for client creation and flag evaluation:
{{< code-block lang="csharp" >}}
using Datadog.Unity.Flags;
@@ -77,6 +77,8 @@ var checkoutClient = DdFlags.Instance.CreateClient("checkout");
Define who or what the flag evaluation applies to using a `FlagsEvaluationContext`. The evaluation context includes user or session information used to determine which flag variations should be returned. Call this method before evaluating flags to help ensure proper targeting.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="csharp" >}}
client.SetEvaluationContext(
new FlagsEvaluationContext(
@@ -180,6 +182,7 @@ When you need more than just the flag value, use the `GetDetails` methods.
* `GetStringDetails(key, defaultValue)` -> `FlagDetails`
* `GetIntegerDetails(key, defaultValue)` -> `FlagDetails`
* `GetDoubleDetails(key, defaultValue)` -> `FlagDetails`
+* `GetDetails(key, defaultValue)` -> `FlagDetails` for object or custom detail results
For example:
@@ -224,6 +227,50 @@ DdFlags.Enable(new FlagsConfiguration(
`customEvaluationEndpoint`
: Configures a custom server URL for sending flags evaluation telemetry.
+## Testing
+
+You can test against a dedicated Datadog test environment with the real `IFlagsClient`, or isolate game logic behind a small application interface and substitute a fake implementation in unit tests. This section shows the fake approach, which keeps tests hermetic and offline.
+
+{{< code-block lang="csharp" >}}
+public interface ICheckoutFlags
+{
+ bool NewCheckoutEnabled();
+}
+
+public sealed class DatadogCheckoutFlags : ICheckoutFlags
+{
+ private readonly IFlagsClient client;
+
+ public DatadogCheckoutFlags(IFlagsClient client)
+ {
+ this.client = client;
+ }
+
+ public bool NewCheckoutEnabled()
+ {
+ return client.GetBooleanValue("new-checkout-flow", false);
+ }
+}
+
+public sealed class TestCheckoutFlags : ICheckoutFlags
+{
+ public bool NewCheckoutEnabled()
+ {
+ return true;
+ }
+}
+
+[Test]
+public void FakeFlagValueCanDriveGameLogic()
+{
+ ICheckoutFlags flags = new TestCheckoutFlags();
+
+ Assert.IsTrue(flags.NewCheckoutEnabled());
+}
+{{< /code-block >}}
+
+Keep calls to `DdFlags.Instance.CreateClient()` at your application boundary. This lets tests replace flag values without initializing the Datadog Unity SDK.
+
## Further reading
{{< partial name="whats-next/whats-next.html" >}}
diff --git a/content/en/feature_flags/feature_flag_mcp_server.md b/content/en/feature_flags/feature_flag_mcp_server.md
index e21464a82bf..a8b0356f1d4 100644
--- a/content/en/feature_flags/feature_flag_mcp_server.md
+++ b/content/en/feature_flags/feature_flag_mcp_server.md
@@ -26,6 +26,10 @@ curl -sSL https://coterm.datadoghq.com/mcp-cli/install.sh | bash
Then follow the instructions below to add the MCP Server to your specific client.
+
+ The Feature Flags MCP Server endpoint uses /api/unstable/. This API is in preview.
+
+
### Claude Code
```bash
@@ -53,7 +57,7 @@ Add this to `~/.cursor/mcp.json` (remember to save the file):
The MCP Server includes tools to help you manage feature flags in your codebase. The following use cases provide sample prompts for using the tools.
- The MCP Server only supports React applications.
+ The code-implementation tools, such as check-flag-implementation, currently target React applications. Other tools, such as list-feature-flags and update-feature-flag-environment, are framework-agnostic.
### Create feature flags
diff --git a/content/en/feature_flags/guide/migrate_from_launchdarkly.md b/content/en/feature_flags/guide/migrate_from_launchdarkly.md
index db61147714f..1015d4dd106 100644
--- a/content/en/feature_flags/guide/migrate_from_launchdarkly.md
+++ b/content/en/feature_flags/guide/migrate_from_launchdarkly.md
@@ -17,7 +17,7 @@ further_reading:
This guide walks you through the process of migrating feature flags from LaunchDarkly to [Datadog Feature Flags][1]. Follow these general steps:
-1. [Install the Datadog SDK.](#install-sdk)
+1. [Install the Datadog Feature Flags provider.](#install-sdk)
2. [Create a feature flag in Datadog and verify its functionality.](#set-up-flag)
3. [Identify critical feature flags in LaunchDarkly.](#identify-critical-flags)
4. [For all non-critical flags, remove existing code.](#remove-non-critical-flags)
@@ -27,7 +27,7 @@ This guide walks you through the process of migrating feature flags from LaunchD
## Migration process
-### 1. Install the Datadog SDK {#install-sdk}
+### 1. Install the Datadog Feature Flags provider {#install-sdk}
Datadog Feature Flags are built on the [OpenFeature][2] standard, which provides vendor-agnostic feature flag APIs. You need to install both the OpenFeature SDK and the Datadog provider for your platform.
@@ -59,7 +59,8 @@ After installation, ensure you have initialized the Datadog provider with your c
import com.datadog.android.flags.FlagsClient
import com.datadog.android.flags.EvaluationContext
-val flagsClient = FlagsClient.getDefault()
+FlagsClient.Builder().build()
+val flagsClient = FlagsClient.get()
// Set evaluation context
flagsClient.setEvaluationContext(
@@ -88,7 +89,7 @@ if (showNewFeature) {
{{< code-block lang="swift" >}}
import DatadogFlags
-let flagsClient = FlagsClient.shared()
+let flagsClient = FlagsClient.create()
// Set evaluation context
flagsClient.setEvaluationContext(
@@ -102,8 +103,8 @@ flagsClient.setEvaluationContext(
)
// Evaluate flag
-let showNewFeature = flagsClient.resolveBooleanValue(
- flagKey: "show-new-feature",
+let showNewFeature = flagsClient.getBooleanValue(
+ key: "show-new-feature",
defaultValue: false
)
@@ -305,7 +306,7 @@ end
Implement a wrapper function that provides a fallback mechanism to use the LaunchDarkly flag values if the application experiences issues fetching the Datadog flag.
-LaunchDarkly and Datadog SDKs use strongly typed methods for flag evaluation (for example, getBooleanValue, getStringValue, getIntegerValue). The examples below demonstrate Boolean flag evaluation. You will need to create similar wrapper functions for each flag type used in your application.
+LaunchDarkly and Datadog Feature Flags SDKs use strongly typed methods for flag evaluation (for example, getBooleanValue, getStringValue, getIntegerValue). The examples below demonstrate Boolean flag evaluation. You will need to create similar wrapper functions for each flag type used in your application.
{{< tabs >}}
{{% tab "Client-side SDKs" %}}
@@ -315,11 +316,17 @@ Implement a wrapper function that provides a fallback mechanism to use the Launc
import com.launchdarkly.sdk.LDContext
import com.launchdarkly.sdk.android.LDClient
import com.launchdarkly.sdk.android.LDConfig
+import android.app.Application
+import com.datadog.android.Datadog
+import com.datadog.android.DatadogSite
+import com.datadog.android.core.configuration.Configuration
import com.datadog.android.flags.Flags
import com.datadog.android.flags.FlagsClient
import com.datadog.android.flags.EvaluationContext
+import com.datadog.android.privacy.TrackingConsent
class FallbackWrapper(
+ private val application: Application,
userId: String,
evaluationContext: Map
) {
@@ -328,7 +335,7 @@ class FallbackWrapper(
init {
val ldConfig = LDConfig.Builder()
- .mobileKey('YOUR_LD_MOBILE_KEY')
+ .mobileKey("YOUR_LD_MOBILE_KEY")
.build()
val cb = LDContext.builder(userId)
@@ -336,14 +343,17 @@ class FallbackWrapper(
cb.set(key, value)
}
val ldContext = cb.build()
- ldClient = LDClient.init(this@BaseApplication, ldConfig, ldContext, 5)
+ ldClient = LDClient.init(application, ldConfig, ldContext, 5)
val ddConfig = Configuration.Builder(
- clientToken = 'YOUR_DD_CLIENT_TOKEN',
- env = 'DD_ENV',
- variant = 'APP_VARIANT_NAME'
+ clientToken = "YOUR_DD_CLIENT_TOKEN",
+ env = "DD_ENV",
+ variant = "APP_VARIANT_NAME"
)
+ .useSite(DatadogSite.US1)
+ .build()
+ Datadog.initialize(application, ddConfig, TrackingConsent.GRANTED)
Flags.enable()
ddClient = FlagsClient.Builder().build()
@@ -384,11 +394,14 @@ class FallbackWrapper {
private let ldClient: LDClient
private let ddClient: FlagsClient
- init(userId: String, evaluationContext: [String: AnyValue] = [:]) {
- let ldConfig = LDConfig(mobileKey: 'YOUR_LD_MOBILE_KEY', autoEnvAttributes: .enabled)
- var ldContext = LDContextBuilder(key: userId)
+ init(userId: String, evaluationContext: [String: String] = [:]) {
+ let ldConfig = LDConfig(mobileKey: "YOUR_LD_MOBILE_KEY", autoEnvAttributes: .enabled)
+ var ldContextBuilder = LDContextBuilder(key: userId)
for (key, value) in evaluationContext {
- ldContext.trySetValue(key, value)
+ ldContextBuilder.trySetValue(key, LDValue.string(value))
+ }
+ guard let ldContext = try? ldContextBuilder.build().get() else {
+ fatalError("Invalid LaunchDarkly context")
}
LDClient.start(config: ldConfig, context: ldContext)
@@ -409,21 +422,23 @@ class FallbackWrapper {
self.ddClient.setEvaluationContext(
FlagsEvaluationContext(
targetingKey: userId,
- attributes: evaluationContext
+ attributes: evaluationContext.mapValues { .string($0) }
)
)
}
func getBooleanFlag(flagKey: String, defaultValue: Bool) -> Bool {
- do {
- return self.ddClient.resolveBooleanValue(
- flagKey: flagKey,
- defaultValue: defaultValue
- )
- } catch {
- print("Falling back to LaunchDarkly for flag: \(flagKey)")
- return self.ldClient.boolVariation(forKey: flagKey, defaultValue: defaultValue)
+ let details = self.ddClient.getBooleanDetails(
+ key: flagKey,
+ defaultValue: defaultValue
+ )
+
+ if details.error == nil {
+ return details.value
}
+
+ print("Falling back to LaunchDarkly for flag: \(flagKey)")
+ return self.ldClient.boolVariation(forKey: flagKey, defaultValue: defaultValue)
}
}
{{< /code-block >}}
@@ -436,13 +451,14 @@ import { OpenFeature } from '@openfeature/web-sdk';
import { DatadogProvider } from '@datadog/openfeature-browser';
class FallbackWrapper {
- private ldClient;
- private ddClient;
+ ldClient;
+ ddClient;
async initialize(userId, evaluationContext = {}) {
try {
const ddProvider = new DatadogProvider({
applicationId: 'YOUR_APP_ID',
clientToken: 'YOUR_CLIENT_TOKEN',
+ site: 'datadoghq.com',
env: 'ENV_NAME',
});
@@ -470,7 +486,7 @@ class FallbackWrapper {
}
return this.ddClient.getBooleanValue(flagKey, defaultValue);
} catch (e) {
- console.warn(`Falling back to LaunchDarkly for flag: ${flagKey});
+ console.warn(`Falling back to LaunchDarkly for flag: ${flagKey}`);
return this.ldClient.variation(flagKey, defaultValue);
}
}
diff --git a/content/en/feature_flags/server/_index.md b/content/en/feature_flags/server/_index.md
index aa877b9316e..bb939e0de93 100644
--- a/content/en/feature_flags/server/_index.md
+++ b/content/en/feature_flags/server/_index.md
@@ -12,7 +12,9 @@ further_reading:
## Overview
-Datadog Feature Flags for server-side applications allow you to remotely control feature availability, run experiments, and roll out new functionality with confidence. Server-side SDKs integrate with the Datadog SDK and use Remote Configuration to receive flag updates in real time.
+Datadog Feature Flags for server-side applications allow you to remotely control feature availability, run experiments, and roll out new functionality with confidence. Server-side SDKs integrate with the Datadog tracer for your language and use Remote Configuration to receive flag updates in real time.
+
+Datadog Feature Flags is built on the [OpenFeature standard](https://openfeature.dev/docs/reference/intro/), an open-source, vendor-neutral specification for feature flag APIs. See OpenFeature's getting-started guide if you're new to OpenFeature concepts like providers, evaluation context, and hooks.
This guide covers the common setup required for all server-side SDKs, including Agent configuration and application environment variables. Select your language or framework to view SDK-specific setup instructions:
@@ -29,7 +31,7 @@ Before setting up server-side feature flags, ensure you have:
## Agent configuration
-Server-side feature flags use [Remote Configuration][1] to deliver flag configurations to your application. Enable Remote Configuration in your Datadog Agent by setting `DD_REMOTE_CONFIGURATION_ENABLED=true` or adding `remote_configuration.enabled: true` to your `datadog.yaml`.
+Server-side feature flags use [Remote Configuration][1] to deliver flag configurations to your application. Remote Configuration is enabled by default in Agent 7.47.0 and later. If your Agent has Remote Configuration disabled, re-enable it by setting `DD_REMOTE_CONFIGURATION_ENABLED=true` or adding `remote_configuration.enabled: true` to your `datadog.yaml`.
See the [Remote Configuration documentation][1] for detailed setup instructions across different deployment environments.
@@ -56,18 +58,17 @@ DD_VERSION=
DD_AGENT_HOST=localhost
DD_TRACE_AGENT_PORT=8126
-# Enable Remote Configuration in the SDK
-DD_REMOTE_CONFIG_ENABLED=true
-
-# Enable the feature flagging provider (required for most SDKs)
+# Required: Enable the feature flagging provider
DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
-# Enable flag evaluation metrics (required for flag evaluation tracking)
+# Optional: Enable flag evaluation metrics
DD_METRICS_OTEL_ENABLED=true
{{< /code-block >}}
The DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true environment variable is required to enable the feature flagging provider. Java also supports the system property -Ddd.experimental.flagging.provider.enabled=true, and Ruby and Node.js support code-based configuration as an alternative. See the SDK-specific documentation for details.
+Remote Configuration must be available for server-side Feature Flags. On supported Agent versions it is enabled by default. Only set SDK-level Remote Configuration variables, such as DD_REMOTE_CONFIG_ENABLED=true, if your tracer has Remote Configuration disabled and you need to override that setting.
+
Set DD_METRICS_OTEL_ENABLED=true to enable flag evaluation metrics. Without this, the SDK does not emit metrics for flag evaluations. When enabled, each evaluation records a feature_flag.evaluations counter metric tagged with the flag key, result variant, and evaluation reason.
## Testing with in-memory providers
diff --git a/content/en/feature_flags/server/dotnet.md b/content/en/feature_flags/server/dotnet.md
index d25658e4b8e..e50e4c2b724 100644
--- a/content/en/feature_flags/server/dotnet.md
+++ b/content/en/feature_flags/server/dotnet.md
@@ -12,7 +12,7 @@ further_reading:
## Overview
-This page describes how to instrument your .NET application with the Datadog Feature Flags SDK. The .NET SDK integrates with [OpenFeature][1], an open standard for feature flag management, and uses the Datadog SDK's Remote Configuration to receive flag updates in real time.
+This page describes how to instrument your .NET application with the Datadog Feature Flags SDK. The .NET SDK integrates with [OpenFeature][1], an open standard for feature flag management, and receives flag updates through Remote Configuration in the Datadog .NET tracer (`dd-trace-dotnet`).
This guide explains how to install and enable the SDK, create an OpenFeature client, and evaluate feature flags in your application.
@@ -32,11 +32,16 @@ Set the following environment variables:
# Required: Enable the feature flags provider
DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+# Optional: Enable flag evaluation metrics
+DD_METRICS_OTEL_ENABLED=true
+
# Required: Service identification
DD_SERVICE=
DD_ENV=
{{< /code-block >}}
+The EXPERIMENTAL_ prefix is retained for backwards compatibility; the provider itself is stable.
+
## Installation
Install the Datadog [.NET SDK][3] and [OpenFeature SDK][4] using NuGet:
@@ -57,7 +62,7 @@ Or add them to your `.csproj` file:
## Initialize the SDK
-Register the Datadog OpenFeature provider with the OpenFeature API. The provider connects to the Datadog SDK's Remote Configuration system to receive flag configurations.
+Register the Datadog OpenFeature provider with the OpenFeature API. The provider connects to the Datadog .NET tracer's Remote Configuration system to receive flag configurations.
### Blocking initialization
@@ -109,6 +114,8 @@ var client = Api.Instance.GetClient("my-service");
Define an evaluation context that identifies the user or entity for flag targeting. The evaluation context includes attributes used to determine which flag variations should be returned:
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="csharp" >}}
using OpenFeature.Model;
diff --git a/content/en/feature_flags/server/go.md b/content/en/feature_flags/server/go.md
index 027ad0da5d2..d82569af67d 100644
--- a/content/en/feature_flags/server/go.md
+++ b/content/en/feature_flags/server/go.md
@@ -12,7 +12,7 @@ further_reading:
## Overview
-This page describes how to instrument your Go application with the Datadog Feature Flags SDK. The Go SDK integrates with [OpenFeature][1], an open standard for feature flag management, and uses the Datadog SDK's Remote Configuration to receive flag updates in real time.
+This page describes how to instrument your Go application with the Datadog Feature Flags SDK. The Go SDK integrates with [OpenFeature][1], an open standard for feature flag management, and receives flag updates through Remote Configuration in the Datadog Go tracer (`dd-trace-go`).
This guide explains how to install and enable the SDK, create an OpenFeature client, and evaluate feature flags in your application.
@@ -20,7 +20,7 @@ This guide explains how to install and enable the SDK, create an OpenFeature cli
Before setting up the Go Feature Flags SDK, ensure you have:
-- **Datadog Agent** with [Remote Configuration][2] enabled
+- **Datadog Agent** version 7.55 or later with [Remote Configuration][2] enabled
- **Datadog [API key][3]** configured on the Agent
- **Datadog Go SDK** `dd-trace-go` version 2.4.0 or later
@@ -30,11 +30,16 @@ Set the following environment variables:
# Required: Enable the feature flags provider
DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+# Optional: Enable flag evaluation metrics
+DD_METRICS_OTEL_ENABLED=true
+
# Required: Service identification
DD_SERVICE=
DD_ENV=
{{< /code-block >}}
+The EXPERIMENTAL_ prefix is retained for backwards compatibility; the provider itself is stable.
+
## Installation
Install the Datadog OpenFeature provider package:
@@ -51,7 +56,7 @@ go get github.com/open-feature/go-sdk/openfeature
## Initialize the SDK
-Start the Datadog SDK and register the Datadog OpenFeature provider. The SDK must be started first because it enables Remote Configuration, which delivers flag configurations to your application.
+Start the Datadog Go tracer and register the Datadog OpenFeature provider. The tracer must be started first because it enables Remote Configuration, which delivers flag configurations to your application.
### Blocking initialization
@@ -154,6 +159,8 @@ client := openfeature.NewClient("my-service")
Define an evaluation context that identifies the user or entity for flag targeting. The evaluation context includes attributes used to determine which flag variations should be returned:
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="go" >}}
evalCtx := openfeature.NewEvaluationContext(
"user-123", // Targeting key (typically user ID)
diff --git a/content/en/feature_flags/server/java.md b/content/en/feature_flags/server/java.md
index 8b3a5fe3236..0fd8963edd1 100644
--- a/content/en/feature_flags/server/java.md
+++ b/content/en/feature_flags/server/java.md
@@ -16,7 +16,7 @@ further_reading:
This page describes how to instrument a Java application with the Datadog Feature Flags SDK. Datadog feature flags provide a unified way to remotely control feature availability in your app, experiment safely, and deliver new experiences with confidence.
-The Java SDK integrates feature flags directly into the Datadog SDK and implements the [OpenFeature](https://openfeature.dev/) standard for maximum flexibility and compatibility.
+The Java SDK integrates feature flags directly into the Datadog Java tracer (`dd-trace-java`) and implements the [OpenFeature](https://openfeature.dev/) standard for maximum flexibility and compatibility.
If you're using Datadog APM and your application already has the Datadog Java SDK and Remote Configuration enabled, skip to
Initialize the OpenFeature provider. You only need to add the OpenFeature dependencies and initialize the provider.
@@ -26,7 +26,7 @@ The Datadog Feature Flags SDK for Java requires:
- **Java 11 or higher**
- **Datadog Java SDK**: Version **1.57.0** or later
- **OpenFeature SDK**: Version **1.18.2** or later
-- **Datadog Agent**: Version **7.x or later** with [Remote Configuration][1] enabled
+- **Datadog Agent**: Version **7.55 or later** with [Remote Configuration][1] enabled
- **Datadog [API key][7]**: Configured on the Agent (not the application) for Remote Configuration
For a full list of Datadog's Java version and framework support, read [Compatibility Requirements](/tracing/trace_collection/compatibility/java/).
@@ -110,20 +110,20 @@ api_key:
### Application configuration
-If your application already runs with `-javaagent:dd-java-agent.jar` and has Remote Configuration enabled (`DD_REMOTE_CONFIG_ENABLED=true`), you only need to add the feature flagging variable (`DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true`). Skip the SDK download and JVM configuration steps.
+If your application already runs with `-javaagent:dd-java-agent.jar` and Remote Configuration is available, you only need to add the feature flagging variable (`DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true`). Skip the SDK download and JVM configuration steps.
Configure your Java application with the required environment variables or system properties:
{{< tabs >}}
{{% tab "Environment Variables" %}}
{{< code-block lang="bash" >}}
-# Required: Enable Remote Configuration in the SDK
-export DD_REMOTE_CONFIG_ENABLED=true
-
# Required: Enable the feature flagging provider
# The EXPERIMENTAL_ prefix is historical; the provider is no longer experimental.
export DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+# Optional: Enable flag evaluation metrics
+export DD_METRICS_OTEL_ENABLED=true
+
# Required: Service name
export DD_SERVICE=
@@ -141,8 +141,8 @@ java -javaagent:path/to/dd-java-agent.jar -jar your-application.jar
{{% tab "System Properties" %}}
{{< code-block lang="bash" >}}
java -javaagent:path/to/dd-java-agent.jar \
- -Ddd.remote.config.enabled=true \
-Ddd.experimental.flagging.provider.enabled=true \
+ -Ddd.metrics.otel.enabled=true \
-Ddd.service= \
-Ddd.env= \
-Ddd.version= \
@@ -151,21 +151,23 @@ java -javaagent:path/to/dd-java-agent.jar \
{{% /tab %}}
{{< /tabs >}}
-The Datadog feature flagging system starts automatically when the tracer is initialized with both Remote Configuration and the feature flagging provider enabled. No additional initialization code is required in your application.
+The Datadog feature flagging system starts automatically when the tracer is initialized with Remote Configuration available and the feature flagging provider enabled. No additional initialization code is required in your application.
-Feature flagging requires both DD_REMOTE_CONFIG_ENABLED=true and DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true. Without these settings, the feature flagging system does not start and the Provider returns the programmatic default.
+Feature flagging requires DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true and Remote Configuration connectivity. Without the provider setting, the feature flagging system does not start and the Provider returns the programmatic default.
+
+Remote Configuration must be available for server-side Feature Flags. On supported Agent versions it is enabled by default. Only set SDK-level Remote Configuration variables, such as DD_REMOTE_CONFIG_ENABLED=true, if your tracer has Remote Configuration disabled and you need to override that setting.
### Add the Java tracer to the JVM
For instructions on how to add the `-javaagent` argument to your application server or framework, see [Add the Java SDK to the JVM](/tracing/trace_collection/automatic_instrumentation/dd_libraries/java/#add-the-java-sdk-to-the-jvm).
Make sure to include the feature flagging configuration flags:
-- `-Ddd.remote.config.enabled=true`
- `-Ddd.experimental.flagging.provider.enabled=true`
+- `-Ddd.metrics.otel.enabled=true` if you want flag evaluation metrics
## Initialize the OpenFeature provider
-Initialize the Datadog OpenFeature provider in your application startup code. The provider connects to the feature flagging system running in the Datadog SDK.
+Initialize the Datadog OpenFeature provider in your application startup code. The provider connects to the feature flagging system running in the Datadog Java tracer.
{{< code-block lang="java" >}}
import dev.openfeature.sdk.OpenFeatureAPI;
@@ -239,6 +241,8 @@ api.setProvider(new Provider());
The evaluation context defines the subject (user, device, session) for flag evaluation. It determines which flag variations are returned based on targeting rules.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="java" >}}
import dev.openfeature.sdk.EvaluationContext;
import dev.openfeature.sdk.MutableContext;
@@ -556,7 +560,7 @@ Before checking infrastructure, confirm the flag itself is set up correctly:
Remote Configuration delivers flag configurations from the Datadog backend to the Agent.
-1. **RC is enabled on the Agent**: Set `remote_configuration.enabled: true` in `datadog.yaml` or `DD_REMOTE_CONFIG_ENABLED=true`. See [Remote Configuration][1].
+1. **RC is enabled on the Agent**: Agent 7.47.0 and later enable Remote Configuration by default. If it has been disabled, set `remote_configuration.enabled: true` in `datadog.yaml` or `DD_REMOTE_CONFIGURATION_ENABLED=true`. See [Remote Configuration][1].
2. **`DD_API_KEY` is valid on the Agent** and belongs to the target organization.
3. **`DD_SITE` is set correctly** on the Agent (`site` in `datadog.yaml` or `DD_SITE` env var). See [Agent Site Issues][3].
4. **Fleet Automation**: Open [Fleet Automation][4], select the Agent your application connects to, and confirm Remote Configuration is active.
@@ -565,7 +569,7 @@ Remote Configuration delivers flag configurations from the Datadog backend to th
### 3. Agent: Verify Agent health and connectivity
1. **Agent is running and reachable**: See [APM Connection Errors][2] for steps to verify Agent connectivity from the tracer.
-2. **Agent version**: Feature flagging requires Agent 7.x or later with EVP Proxy support.
+2. **Agent version**: Feature flagging requires Agent 7.55 or later with EVP Proxy support.
3. **EVP proxy is available**: Query the Agent's info endpoint and confirm the response includes `evp_proxy/v4/` and `v0.7/config` in the `endpoints` array:
```bash
curl http://localhost:8126/info
diff --git a/content/en/feature_flags/server/nodejs.md b/content/en/feature_flags/server/nodejs.md
index 46454ac6185..5c2d95e8fa7 100644
--- a/content/en/feature_flags/server/nodejs.md
+++ b/content/en/feature_flags/server/nodejs.md
@@ -15,13 +15,13 @@ further_reading:
## Overview
-This page describes how to instrument your Node.js application with the Datadog Feature Flags SDK. The Node.js SDK integrates with [OpenFeature][2], an open standard for feature flag management, and uses the Datadog SDK's Remote Configuration to receive flag updates in real time.
+This page describes how to instrument your Node.js application with the Datadog Feature Flags SDK. The Node.js SDK integrates with [OpenFeature][2], an open standard for feature flag management, and receives flag updates through Remote Configuration in the Datadog Node.js tracer (`dd-trace`).
## Prerequisites
Before setting up the Node.js Feature Flags SDK, ensure you have:
-- **Datadog Agent** with [Remote Configuration](/agent/remote_config/) enabled. See [Agent Configuration](/feature_flags/server#agent-configuration) for details.
+- **Datadog Agent** version 7.55 or later with [Remote Configuration](/agent/remote_config/) enabled. See [Agent Configuration](/feature_flags/server#agent-configuration) for details.
- **Datadog [API key][3]** configured on the Agent
- **Datadog Node.js SDK** `dd-trace` version 5.80.0 or later
- **@openfeature/server-sdk** version ~1.20.0
@@ -34,6 +34,20 @@ Feature Flagging is provided by Application Performance Monitoring (APM). To int
npm install dd-trace @openfeature/server-sdk
```
+Enable the provider with environment variables:
+
+```shell
+# Required: Enable the feature flags provider
+DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+
+# Optional: Enable flag evaluation metrics
+DD_METRICS_OTEL_ENABLED=true
+```
+
+The EXPERIMENTAL_ prefix is retained for backwards compatibility; the provider itself is stable.
+
+Or enable the provider in code:
+
```javascript
import { OpenFeature } from '@openfeature/server-sdk'
import tracer from 'dd-trace';
@@ -116,6 +130,8 @@ app.get('/my-endpoint', async (req, res) => {
Define who or what the flag evaluation applies to using an `EvaluationContext`. The evaluation context can include user or session information used to determine which flag variations should be returned. Call the `OpenFeature.setContext` method before evaluating flags to ensure proper targeting.
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
## Evaluate flags
After creating the `OpenFeature` client as described in the [Installing and initializing](#installing-and-initializing) section, you can start reading flag values throughout your app. Flag evaluation uses locally cached data, so no network requests occur when evaluating flags.
diff --git a/content/en/feature_flags/server/python.md b/content/en/feature_flags/server/python.md
index 5e6ddb3d1cd..f443c061006 100644
--- a/content/en/feature_flags/server/python.md
+++ b/content/en/feature_flags/server/python.md
@@ -12,7 +12,7 @@ further_reading:
## Overview
-This page describes how to instrument your Python application with the Datadog Feature Flags SDK. The Python SDK integrates with [OpenFeature][1], an open standard for feature flag management, and uses the Datadog SDK's Remote Configuration to receive flag updates in real time.
+This page describes how to instrument your Python application with the Datadog Feature Flags SDK. The Python SDK integrates with [OpenFeature][1], an open standard for feature flag management, and receives flag updates through Remote Configuration in the Datadog Python tracer (`ddtrace`).
This guide explains how to install and enable the SDK, create an OpenFeature client, and evaluate feature flags in your application.
@@ -20,10 +20,10 @@ This guide explains how to install and enable the SDK, create an OpenFeature cli
Before setting up the Python Feature Flags SDK, ensure you have:
-- **Datadog Agent** with [Remote Configuration][2] enabled
+- **Datadog Agent** version 7.55 or later with [Remote Configuration][2] enabled
- **Datadog [API key][3]** configured on the Agent
- **Datadog Python SDK** `ddtrace` version 3.19.0 or later
-- **OpenFeature Python SDK** `openfeature-sdk` version 0.5.0 or later
+- **OpenFeature Python SDK** `openfeature-sdk` version 0.7.0 or later if you use provider event handlers to wait for initialization. If you do not use that pattern, version 0.5.0 or later is sufficient.
Set the following environment variables:
@@ -31,11 +31,16 @@ Set the following environment variables:
# Required: Enable the feature flags provider
export DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+# Optional: Enable flag evaluation metrics
+export DD_METRICS_OTEL_ENABLED=true
+
# Required: Service identification
export DD_SERVICE=
export DD_ENV=
{{< /code-block >}}
+The EXPERIMENTAL_ prefix is retained for backwards compatibility; the provider itself is stable.
+
## Installation
Install the Datadog Python SDK and OpenFeature SDK:
@@ -53,7 +58,7 @@ openfeature-sdk>=0.5.0
## Initialize the SDK
-Register the Datadog OpenFeature provider with the OpenFeature API. The provider connects to the Datadog SDK's Remote Configuration system to receive flag configurations.
+Register the Datadog OpenFeature provider with the OpenFeature API. The provider connects to the Datadog Python tracer's Remote Configuration system to receive flag configurations.
{{< code-block lang="python" >}}
from ddtrace import tracer
@@ -77,6 +82,8 @@ client = api.get_client()
Define an evaluation context that identifies the user or entity for flag targeting. The evaluation context includes attributes used to determine which flag variations should be returned:
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
{{< code-block lang="python" >}}
from openfeature.evaluation_context import EvaluationContext
diff --git a/content/en/feature_flags/server/ruby.md b/content/en/feature_flags/server/ruby.md
index f1709a09b25..4a169766769 100644
--- a/content/en/feature_flags/server/ruby.md
+++ b/content/en/feature_flags/server/ruby.md
@@ -15,18 +15,18 @@ further_reading:
## Overview
-This page describes how to instrument your Ruby application with the Datadog Feature Flags SDK. The Ruby SDK integrates with [OpenFeature][3], an open standard for feature flag management, and uses the Datadog SDK's Remote Configuration to receive flag updates in real time.
+This page describes how to instrument your Ruby application with the Datadog Feature Flags SDK. The Ruby SDK integrates with [OpenFeature][3], an open standard for feature flag management, and receives flag updates through Remote Configuration in the Datadog Ruby tracer (`datadog` gem).
## Prerequisites
Before setting up the Ruby Feature Flags SDK, ensure you have:
-- **Datadog Agent** with [Remote Configuration][1] enabled
+- **Datadog Agent** version 7.55 or later with [Remote Configuration][1] enabled
- **Datadog [API key][4]** configured on the Agent
-- **Datadog Ruby SDK** `datadog` version 2.23.0 or later
-- **OpenFeature Ruby SDK** `openfeature-sdk` version 0.4.1 or later
+- **Datadog Ruby SDK** `datadog` version 2.24.0 or later
+- **OpenFeature Ruby SDK** `openfeature-sdk` version 0.5.1 or later if you need flag evaluation metrics support
- **Service and environment configured** - Feature flags are targeted by service and environment
-- **Supported operating system** - Feature flags are only [supported on Linux operating systems][2]. Windows and macOS are not natively supported, but Dockerized Linux environments running on those operating systems are.
+- **Supported operating system** - Production support is currently limited to [Linux operating systems][2]. macOS can be used for local development when a compatible prebuilt native artifact is available. Windows and macOS are not natively supported production targets, but Dockerized Linux environments running on those operating systems are.
## Installing and initializing
@@ -34,9 +34,23 @@ Before setting up the Ruby Feature Flags SDK, ensure you have:
Feature Flagging is provided by Application Performance Monitoring (APM). To integrate APM into your application with feature flagging support, install the required gems and configure Remote Configuration with OpenFeature support.
```shell
-gem install ddtrace openfeature-sdk
+gem install datadog openfeature-sdk
```
+You can enable Feature Flags with environment variables:
+
+```shell
+# Required: Enable the feature flags provider
+DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+
+# Optional: Enable flag evaluation metrics
+DD_METRICS_OTEL_ENABLED=true
+```
+
+The EXPERIMENTAL_ prefix is retained for backwards compatibility; the provider itself is stable.
+
+Or enable the provider in code:
+
```ruby
require 'datadog'
require 'open_feature/sdk'
@@ -69,6 +83,8 @@ Using `set_provider_and_wait` blocks your application from proceeding until the
Define an evaluation context that identifies the user or entity for flag targeting. The evaluation context includes attributes used to determine which flag variations should be returned:
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
```ruby
context = OpenFeature::SDK::EvaluationContext.new(
targeting_key: 'user-123', # Targeting key (typically user ID)
@@ -263,7 +279,7 @@ If feature flags unexpectedly always return default values, check the following:
### Remote Configuration connection issues
-Check the Datadog SDK logs for Remote Configuration status:
+Check the Datadog Ruby tracer logs for Remote Configuration status:
```ruby
# Enable startup and debug logging
diff --git a/content/en/getting_started/feature_flags/_index.md b/content/en/getting_started/feature_flags/_index.md
index 61553c2278a..bc66b86c7dd 100644
--- a/content/en/getting_started/feature_flags/_index.md
+++ b/content/en/getting_started/feature_flags/_index.md
@@ -29,7 +29,7 @@ Datadog feature flags offer a powerful, integrated way to manage feature deliver
- **Real-time metrics:** Understand who's receiving each variant, as well as how your flag impacts the health & performance of your application—all in real time.
-- **Supports any data type:** Use Booleans, strings, numbers or full JSON objects—whatever your use case requires.
+- **Supports common flag types:** Use Boolean, string, integer, numeric (float/double), or JSON variants. JavaScript SDKs use `getNumberValue()` for both integer and numeric variants, while Java, Swift, Kotlin, and Python expose separate integer and floating-point evaluation methods.
- **Built for experimentation:** Target specific audiences for A/B tests, roll out features gradually with canary releases, and automatically roll back when regressions are detected.
@@ -57,23 +57,30 @@ Your organization likely already has pre-configured environments for Development
### Step 1: Import and initialize the SDK
-First, install `@datadog/openfeature-browser`, `@openfeature/web-sdk`, and `@openfeature/core` as dependencies in your project:
+Choose the SDK that matches where the flag is evaluated and initialize the Datadog Feature Flags provider.
-```
+{{< tabs >}}
+{{% tab "JavaScript browser" %}}
+
+Install `@datadog/openfeature-browser`, `@openfeature/web-sdk`, and `@openfeature/core` as dependencies in your project:
+
+{{< code-block lang="bash" >}}
yarn add @datadog/openfeature-browser @openfeature/web-sdk @openfeature/core
-```
+{{< /code-block >}}
Then, add the following to your project to initialize the SDK:
-```js
+Note: Browser Feature Flags are currently not supported on GovCloud sites.
+
+{{< code-block lang="javascript" >}}
import { DatadogProvider } from '@datadog/openfeature-browser';
import { OpenFeature } from '@openfeature/web-sdk';
// Initialize the provider
const provider = new DatadogProvider({
- clientToken: '',
+ // Required client-side Datadog credentials
applicationId: '',
- enableExposureLogging: true, // Can impact RUM costs if enabled
+ clientToken: '',
site: 'datadoghq.com',
env: '', // Same environment normally passed to the RUM SDK
service: '',
@@ -82,21 +89,149 @@ const provider = new DatadogProvider({
// Set the provider
await OpenFeature.setProviderAndWait(provider);
-```
+{{< /code-block >}}
+
+The browser SDK emits three independent telemetry streams, all enabled by default. enableExposureLogging sends per-evaluation exposure events to the exposures intake. enableFlagEvaluationTracking sends aggregated evaluation telemetry to the flag-evaluation intake. enableRumFeatureFlagTracking attaches flag evaluations to RUM events and is the setting that can affect RUM usage. Disable only the stream you do not need.
+
+{{% /tab %}}
+{{% tab "Node.js server" %}}
+
+Install `dd-trace` and the OpenFeature server SDK:
+
+{{< code-block lang="bash" >}}
+npm install dd-trace @openfeature/server-sdk
+{{< /code-block >}}
+
+Enable the provider with environment variables:
+
+{{< code-block lang="bash" >}}
+# Required: Enable the feature flags provider
+DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+
+# Optional: Enable flag evaluation metrics
+DD_METRICS_OTEL_ENABLED=true
+{{< /code-block >}}
+
+Or enable the provider in code:
+
+{{< code-block lang="javascript" >}}
+import { OpenFeature } from '@openfeature/server-sdk'
+import tracer from 'dd-trace';
+
+tracer.init({
+ experimental: {
+ flaggingProvider: {
+ enabled: true,
+ }
+ }
+});
+
+OpenFeature.setProvider(tracer.openfeature);
+{{< /code-block >}}
+
+{{% /tab %}}
+{{% tab "Java" %}}
+
+Add the OpenFeature SDK and Datadog OpenFeature provider dependencies:
+
+{{< code-block lang="groovy" filename="build.gradle" >}}
+dependencies {
+ // OpenFeature SDK for flag evaluation
+ implementation 'dev.openfeature:sdk:1.18.2'
+
+ // Datadog OpenFeature Provider
+ implementation 'com.datadoghq:dd-openfeature:1.57.0'
+}
+{{< /code-block >}}
+
+Enable the provider and start your application with the Java tracer:
+
+{{< code-block lang="bash" >}}
+# Required: Enable the feature flagging provider
+# The EXPERIMENTAL_ prefix is historical; the provider is no longer experimental.
+export DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+
+# Optional: Enable flag evaluation metrics
+export DD_METRICS_OTEL_ENABLED=true
+
+java -javaagent:path/to/dd-java-agent.jar -jar your-application.jar
+{{< /code-block >}}
+
+Register the Datadog OpenFeature provider:
+
+{{< code-block lang="java" >}}
+import dev.openfeature.sdk.OpenFeatureAPI;
+import dev.openfeature.sdk.Client;
+import datadog.trace.api.openfeature.Provider;
+
+OpenFeatureAPI api = OpenFeatureAPI.getInstance();
+api.setProviderAndWait(new Provider());
+Client client = api.getClient("my-app");
+{{< /code-block >}}
+
+{{% /tab %}}
+{{% tab "Python" %}}
-Setting
enableExposureLogging to
true can impact
RUM costs, as it sends exposure events to Datadog through RUM. You can disable it if you don't need to track feature exposure or guardrail metric status.
+Enable the provider with environment variables:
-More information about OpenFeature SDK configuration options can be found in its [documentation][1]. For more information on creating client tokens and application IDs, see [API and Application Keys][4].
+{{< code-block lang="bash" >}}
+# Required: Enable the feature flags provider
+export DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED=true
+
+# Optional: Enable flag evaluation metrics
+export DD_METRICS_OTEL_ENABLED=true
+{{< /code-block >}}
+
+Install the Datadog Python SDK and OpenFeature SDK:
+
+{{< code-block lang="bash" >}}
+pip install ddtrace openfeature-sdk
+{{< /code-block >}}
+
+Register the Datadog OpenFeature provider:
+
+{{< code-block lang="python" >}}
+from ddtrace import tracer
+from openfeature import api
+from ddtrace.openfeature import DataDogProvider
+
+# Initialize the tracer (required for Remote Configuration)
+tracer.configure()
+
+# Create and register the Datadog provider
+provider = DataDogProvider()
+api.set_provider(provider)
+
+# Create an OpenFeature client
+client = api.get_client()
+{{< /code-block >}}
+
+{{% /tab %}}
+{{< /tabs >}}
+
+### Credentials at a glance
+
+| Credential | Used by | Where it goes | Sensitive? |
+| --- | --- | --- | --- |
+| Client token | Browser, mobile, and game SDKs | Client application configuration | Public-shipping token |
+| Application ID | Browser and RUM-backed client SDKs | Client application configuration | Public-shipping identifier |
+| API key | Datadog Agent for server-side Remote Configuration | Agent configuration only | Secret |
+
+Do not put API keys in browser, mobile, or game applications.
+
+See the platform-specific SDK documentation linked above for more configuration details. For more information on creating client tokens and application IDs, see [API and Application Keys][4].
### Step 2: Create a feature flag
Go to [**Create Feature Flag**][2] in Datadog and configure the following:
- **Name and key**: The flag's display name and the key referenced in code
-- **Variant type**: The data type for the flag variants (Boolean, string, integer, number, or JSON)
+- **Variant type**: The data type for the flag variants (Boolean, string, integer, numeric (float/double), or JSON)
**Note**: The flag key and variant type cannot be modified after creation.
+ JavaScript SDKs use `getNumberValue()` for both integer and numeric variants. Java, Swift, Kotlin, and Python expose integer and floating-point methods separately.
+
- **Variant values**: The possible values the flag can return (you can add these later)
- **Distribution channels**: Which types of SDKs receive this flag's configuration (client-side, server-side, or both)
@@ -110,7 +245,12 @@ Go to [**Create Feature Flag**][2] in Datadog and configure the following:
In your application code, use the SDK to evaluate the flag and gate the new feature.
-```js
+Datadog Feature Flags requires evaluation context attributes to be flat primitive values: strings, numbers, and Booleans. Do not pass nested objects or arrays; they are not supported and can cause exposure data to be dropped.
+
+{{< tabs >}}
+{{% tab "JavaScript browser" %}}
+
+{{< code-block lang="javascript" >}}
import { OpenFeature } from '@openfeature/web-sdk';
const client = OpenFeature.getClient();
@@ -132,9 +272,76 @@ const showFeature = await client.getBooleanValue('show-new-feature', fallback);
if (showFeature) {
// Feature code here
}
-```
+{{< /code-block >}}
+
+{{% /tab %}}
+{{% tab "Node.js server" %}}
+
+{{< code-block lang="javascript" >}}
+const evaluationContext = {
+ targetingKey: req.session?.userID ?? 'unknown',
+ companyID: req.session?.companyID
+};
+
+const isNewCheckoutEnabled = await client.getBooleanValue(
+ 'new-checkout-flow', // flag key
+ false, // default value
+ evaluationContext, // context
+);
+
+if (isNewCheckoutEnabled) {
+ showNewCheckoutFlow();
+} else {
+ showLegacyCheckout();
+}
+{{< /code-block >}}
+
+{{% /tab %}}
+{{% tab "Java" %}}
+
+{{< code-block lang="java" >}}
+import dev.openfeature.sdk.EvaluationContext;
+import dev.openfeature.sdk.MutableContext;
+
+EvaluationContext context = new MutableContext("user-123")
+ .add("email", "user@example.com")
+ .add("tier", "premium");
+
+boolean enabled = client.getBooleanValue("checkout.new", false, context);
+
+if (enabled) {
+ // New checkout flow
+} else {
+ // Old checkout flow
+}
+{{< /code-block >}}
+
+{{% /tab %}}
+{{% tab "Python" %}}
+
+{{< code-block lang="python" >}}
+from openfeature.evaluation_context import EvaluationContext
+
+eval_ctx = EvaluationContext(
+ targeting_key="user-123",
+ attributes={
+ "email": "user@example.com",
+ "tier": "premium"
+ }
+)
+
+enabled = client.get_boolean_value("new-checkout-flow", False, eval_ctx)
+
+if enabled:
+ show_new_checkout()
+else:
+ show_legacy_checkout()
+{{< /code-block >}}
+
+{{% /tab %}}
+{{< /tabs >}}
-After you've completed this step, redeploy the application to pick up these changes. Additional usage examples can be found in the SDK's [documentation][1].
+After you've completed this step, redeploy the application to pick up these changes. Additional usage examples can be found in the platform-specific SDK pages linked above.
### Step 4: Define targeting rules and enable the feature flag
@@ -168,7 +375,6 @@ Monitor the feature rollout from the feature flag details page, which provides r
{{< partial name="whats-next/whats-next.html" >}}
-[1]: https://openfeature.dev/docs/reference/technologies/client/web/
[2]: https://app.datadoghq.com/feature-flags/create
[3]: https://app.datadoghq.com/feature-flags/settings/environments
[4]: https://docs.datadoghq.com/account_management/api-app-keys/#client-tokens