-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(dart): Add feature flags documentation #13391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
1a5e762
1792c7d
6060be5
9b2a7a7
8e5ac64
4fcfdd2
ac58e31
7403efd
ac9439c
fd6c983
bec3b50
7685c83
d43329e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| title: Set Up Feature Flags | ||
| sidebar_order: 7000 | ||
| description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log feature flag changes, and reports any suspicious updates that may have caused an error. | ||
| --- | ||
|
|
||
| <PlatformContent includePath="feature-flags/prerelease-alert" /> | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [Sentry SDK](/platforms/dart/#configure) version `9.0.0` or higher is installed. | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Enable Evaluation Tracking | ||
|
|
||
| If you use a third-party SDK to evaluate feature flags, you can enable a Sentry SDK integration to track those evaluations. Integrations are provider specific. Documentation for supported SDKs is listed below. | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - [Firebase Remote Config](/platforms/dart/configuration/integrations/firebase-remote-config/) | ||
|
|
||
| ### Manual Usage | ||
|
|
||
| Call `Sentry.addFeatureFlag` to track feature flag evaluations. | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```dart | ||
| Sentry.addFeatureFlag("feature_flag_a", true); | ||
| ``` | ||
|
|
||
| Calling this function multiple times with the same flag name will override the previous value. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| title: Firebase Remote Config | ||
| description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK." | ||
| sidebar_order: 50 | ||
| redirect_from: | ||
| - /platforms/dart/guides/firebase-remote-config/ | ||
| --- | ||
|
|
||
| <Include name="dart-integrations/firebase-remote-config.mdx" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| title: Firebase Remote Config | ||
| description: "Learn more about the Sentry Firebase Remote Config integration for the Flutter SDK." | ||
| sidebar_order: 60 | ||
| redirect_from: | ||
| - /platforms/dart/guides/flutter/firebase-remote-config/ | ||
| --- | ||
|
|
||
| <Include name="dart-integrations/firebase-remote-config.mdx" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| title: Firebase Remote Config | ||
| description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK." | ||
| sidebar_order: 6 | ||
| platforms: | ||
| - flutter | ||
| --- | ||
|
|
||
| The `sentry_firebase_remote_config` integration provides [Firebase Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=flutter) support for Sentry thus providing insight into feature flag evaluations. | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Behavior | ||
|
|
||
| - Adding the `SentryFirebaseRemoteConfig` integration will automatically track feature flag evaluations. | ||
| - Only boolean values are supported. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. [Sentry SDK](/platforms/dart/#configure) version `9.0.0` or higher is installed. | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 2. Firebase Remote Config is set up. | ||
|
|
||
| ## Install | ||
|
|
||
| To use the `SentryFirebaseRemoteConfig` integration, add the `sentry_firebase_remote_config` dependency. | ||
|
|
||
| ```yml {filename:pubspec.yaml} | ||
| dependencies: | ||
| sentry: ^9.0.0 | ||
| sentry_firebase_remote_config: ^9.0.0 | ||
| ``` | ||
|
|
||
| ## Configure | ||
|
|
||
| Add the `SentryFirebaseRemoteConfig` integration to the Sentry SDK initialization. The integration will automatically call `await remoteConfig.activate();` when the config is updated. | ||
| If you don't want this behavior, you can set `activateOnConfigUpdated` to `false`. | ||
|
|
||
| ```dart | ||
| await SentryFlutter.init( | ||
| (options) { | ||
| options.addIntegration( | ||
| SentryFirebaseRemoteConfigIntegration( | ||
| firebaseRemoteConfig: firebaseRemoteConfig, | ||
| activateOnConfigUpdated: false, | ||
| ), | ||
| ); | ||
| }, | ||
| ); | ||
| ``` | ||
denrase marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Verify & View | ||
|
|
||
| ### 1. Update Firebase Remote Config value | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Update a boolean [Firebase Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=flutter) value to true. Keep in mind that values will be evaluated as bool if there string values are `true`, `false`, `1`, or `0`. So keep in mind that numerical values of `1` or `0` will be evaluated as `true` or `false` boolean values. | ||
denrase marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### 2. View the Recorded Feature Flag Evaluation on Sentry.io | ||
|
|
||
| To view the recorded feature flag evaluation, log into [sentry.io](https://sentry.io) and open your project. | ||
|
|
||
| The recorded feature flag evaluations will be visible in the event context. | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.