This product is not supported for your selected Datadog site. ().
Overview
Datadog Feature Flags server SDKs use agentless delivery: they receive flag configuration directly from the Datadog-managed CDN and evaluate flags locally. Agentless delivery does not require a Datadog Agent.
The SDKs implement the OpenFeature standard. Register the Datadog provider with OpenFeature to use its evaluation API.
Getting started
Choose a language for the minimum installation, configuration, and evaluation example:
Use the following SDK versions or later. These are the baselines for the language guides and shared instructions.
SDK
Minimum version for this guide
Java dd-openfeature
1.69.0
Node.js dd-trace
6.24.0
Python ddtrace
4.17.0
.NET tracer and Datadog.FeatureFlags.OpenFeature
3.57.0 and 2.3.2
Ruby datadog
2.49.0
Go dd-trace-go
2.12.0
PHP datadog/dd-trace
1.28.0
Create a flag with the Server distribution channel enabled. Configure a Datadog API key and the flag environment in the application process:
If your organization uses a site other than datadoghq.com, set DD_SITE. For the selected site, use .
Then initialize the provider and evaluate the flag as shown on the language page. No Feature Flags enablement or source setting is required for new setups, except PHP:
# PHP requires explicit source selection before startup.exportDD_FEATURE_FLAGS_CONFIGURATION_SOURCE=agentless
Java uses the standalone dd-openfeature dependency. .NET still requires the tracer to be loaded with automatic instrumentation. PHP still requires the native extension. See each language guide for runtime requirements.
DD_SERVICE and DD_VERSION are optional attribution settings. Metrics, tracing, and custom polling settings are not required to receive flags.
Collect traces with flag evaluations
Use this optional setup to inspect request errors and latency by flag variant. Configure APM tracing, then enable APM trace enrichment for a supported SDK. The SDK attaches flag evaluation data to the active request trace.
For Java, load dd-java-agent 1.69.0 or later to collect traces and attach flag evaluations. See Collect traces with flag evaluations in Java. Keep the application’s existing flag configuration source when adding tracing.
Set DD_FEATURE_FLAGS_ENABLED=false to disable Feature Flags. See Activation and billing for when delivery starts.
Migrate from Agent delivery
An existing deployment can remain on Agent delivery because of legacy enablement settings. Follow Migrate an existing Remote Configuration setup to move credentials into the application, select agentless delivery, and verify updates.
Use Agent delivery
To keep Agent delivery, configure Datadog Agent 7.55 or later with Remote Configuration enabled and an API key. Set this variable in the application:
Integration tests: Point DatadogProvider at a dedicated test environment and control flag values from the Datadog UI. This exercises the real provider and selected configuration source end-to-end.
Unit tests: Swap DatadogProvider for OpenFeature’s standard InMemoryProvider (or an equivalent test stub, where no in-memory provider is available in the language) and set flag values directly in test code. This keeps tests hermetic and offline.
This section covers the in-memory approach. Because the OpenFeature API is designed to make providers swappable at runtime, your application code does not change โ only the provider registered during test setup.
A typical test follows this pattern:
Build a map of flag keys to variants in your test setup.
Register an InMemoryProvider with that map through the OpenFeature API.
Call the OpenFeature client in the units being tested. The InMemoryProvider returns the flag assignments configured at test setup.
Reset the provider in test teardown to avoid cross-test state leakage.
See your language’s SDK page (select from the top of this page) for a concrete test example.
Context attribute requirements
Evaluation context attributes must be flat primitive values (strings, numbers, booleans). Nested objects and arrays are not supported and will cause exposure events to be silently dropped.
// These attributes will cause exposure events to be dropped
constevaluationContext={targetingKey:req.session?.userID,company:{id:req.session?.companyID},// nested object - NOT SUPPORTED
roles:['admin','user']// array - NOT SUPPORTED
};
Opt out individual subjects
Configure evaluation telemetry and experiment participation independently for each subject. Support and release requirements differ by SDK. See Flag Evaluation and Experimentation Opt-Out for the support matrix, mode behavior, and language-specific examples.
Supply preferences in each evaluation’s context. Do not change a shared global context for individual server requests.