![]() |
VOOZH | about |
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, an open-source, vendor-neutral specification for feature flag APIs. If you’re new to OpenFeature concepts like providers, evaluation context, and hooks, see the OpenFeature concepts documentation.
The web, mobile, and Unity providers expose similar telemetry controls with platform-specific option names. Each exposed option defaults to true, so the listed behaviors are on by default; set the option to false to opt out.
FlagsClient API directly.Default: true. Set to false to disable.
@datadog/openfeature-browser): enableExposureLoggingdd-sdk-android-flags): trackExposuresDatadogFlags): trackExposurestrackExposurestrackExposuresDefault: true. Set to false to disable.
@datadog/openfeature-browser): enableFlagEvaluationTrackingdd-sdk-android-flags): trackEvaluationsDatadogFlags): trackEvaluationstrackEvaluationsDefault: true. Set to false to disable.
@datadog/openfeature-browser): enableRumFeatureFlagTrackingdd-sdk-android-flags): rumIntegrationEnabledDatadogFlags): rumIntegrationEnabledrumIntegrationEnabledDatadog supports these testing approaches:
DatadogProvider at a dedicated test environment and control flag values from the Datadog UI. This exercises the real provider end-to-end, including the CDN-delivered flag assignments.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:
InMemoryProvider with that map through the OpenFeature API.InMemoryProvider returns the flag assignments configured at test setup.See your platform’s SDK page (select from the top of this page) for a concrete test example.
Use flat attributes in your evaluation context:
const evaluationContext = {
targetingKey: 'user-123',
userId: 'user-123',
tier: 'premium',
age: 25
};
await OpenFeature.setProviderAndWait(provider, evaluationContext);Avoid nested objects and arrays:
// These attributes will cause exposure events to be dropped
const evaluationContext = {
targetingKey: 'user-123',
user: { id: 'user-123' }, // nested object - NOT SUPPORTED
features: ['beta', 'analytics'] // array - NOT SUPPORTED
};For percentage-based rollouts and deterministic bucketing, see Traffic Splitting and Randomization.
Additional helpful documentation, links, and articles:
| |