diff --git a/docs/platforms/react-native/feature-flags/index.mdx b/docs/platforms/react-native/feature-flags/index.mdx new file mode 100644 index 0000000000000..1ebe0c019e338 --- /dev/null +++ b/docs/platforms/react-native/feature-flags/index.mdx @@ -0,0 +1,28 @@ +--- +title: Set Up Feature Flags +sidebar_title: Feature Flags +sidebar_order: 7000 +description: Generic Feature Flags Integration. +--- + +## Prerequisites + +- [Sentry SDK](/platforms/react-native/#configure) version `7.0.0`. + +## Usage + +The Feature Flags integration allows you to manually track feature flag evaluations through an API. These evaluations are held in memory and sent to Sentry on error and transaction events. **At the moment, we only support boolean flag evaluations.** + +```javascript +import * as Sentry from "@sentry/react-native"; + +const flagsIntegration = Sentry.featureFlagsIntegration(); +flagsIntegration.addFeatureFlag('feature_flag_a', true); + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [flagsIntegration], +}); +``` + +Calling this function multiple times with the same flag name will override the previous value.