Skip to main content

How Feature Flag Integration Works

The Recording SDK works with the Confidence JavaScript SDK and the Confidence OpenFeature web provider. Recordings include feature flag variants that these SDKs evaluate in the same browser. You can find the observed flags and variants in recording details. You can also use them to filter the Recordings list. Server-side flag evaluations do not appear automatically because they occur outside the recorded browser.

Align Targeting Context

The Feature Flag SDK and Recording SDK receive context separately:
  • Feature flag context controls flag targeting and assignment.
  • Recording context controls recording rules and sampling.
One SDK does not copy context to the other. Pass the same identifiers and targeting attributes to both SDKs when their rules must select the same users.
Use the same field name and value for the targeting entity in both sets of rules. For example, if the feature flag rule targets user_id, select user_id in the recording rule and pass the same value to both SDKs.

Keep Context Stable

The Recording SDK uses the context supplied during initialization. Later changes to the feature flag context do not update the recording context. Initialize both SDKs after you have the identifiers and attributes needed for targeting. Keep personal data, access tokens, and secrets out of both contexts.

What Context Alignment Changes

Context alignment makes recording and feature flag rules target users consistently. It does not control whether observed feature flag variants appear in a recording. For example, matching context lets both rule sets target premium users. If the values differ, a user can match a feature flag rule but not the corresponding recording rule.

Recording rules

Control which users and sessions the SDK records.

Evaluation context

Learn how Confidence SDKs use context for feature flags.