Feature Flags¶
Experimental
This is an experimental feature and the APIs are subject to change.
The feature flags API allow you to signal to bitdrift when a given user was exposed to particular feature flags. This will be important because your feature flags will affect how your app behaves.
Feature flag exposure events are processed by the workflow engine and may be used to progress workflows similar to logs and will be available to query for the duration of the process lifetime.
Workflow Matching Requirements
Workflow matching on feature flag state and transitions requires SDK version 0.21.2 or later (React Native 0.10.2 or later). Earlier versions support feature flag exposure for issue reports but not workflow matching.
Calling the exposure function multiple times for the same feature flag will result in a new exposure event being emitted and the internal state for this feature flag to be updated. This should be done with care as this may erase knowledge about exposing the user to a feature flag variant within issue reports.
The APIs accept either a variant name or a boolean flag. While we support multi-variant feature flags, the expectation is that false maps to the control variant (feature disabled) while true maps to the treatment variant (feature enabled). When using string-based variant names consider using a similar scheme as this consistency will improve the usefulness of feature flag analysis tooling what will come in the future.
See the Product > Issues Feature Guide to learn more about how to see feature flags in issue reports.
See the Product > Workflow Feature Guide to learn more about how to see feature flags in workflows.
import io.bitdrift.capture.Capture.Logger
// Call this at the time of exposure (not assignment)
Logger.setFeatureFlagExposure("my-flag", "my-variant")
Logger.setFeatureFlagExposure("my-no-variant-flag", true)
import io.bitdrift.capture.Capture.Logger;
// Call this at the time of exposure (not assignment)
Logger.setFeatureFlagExposure("my-flag", "my-variant");
Logger.setFeatureFlagExposure("my-no-variant-flag", true);
import Capture
// Call this at the time of exposure (not assignment)
Logger.setFeatureFlagExposure(withName: "my-flag", variant: "my-variant");
Logger.setFeatureFlagExposure(withName: "my-no-variant-flag", variant: true);