-
-
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
Merged
buenaflor
merged 13 commits into
getsentry:master
from
denrase:denrase/flutter-feature-flags
Jun 16, 2025
Merged
Changes from 9 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1a5e762
docs(dart): Add feature flags documentation
denrase 1792c7d
samller fixes
denrase 6060be5
implment feedback
denrase 9b2a7a7
fix 404
denrase 8e5ac64
Merge branch 'master' into denrase/flutter-feature-flags
denrase 4fcfdd2
add review feedback
denrase ac58e31
Merge branch 'getsentry:master' into denrase/flutter-feature-flags
denrase 7403efd
feedback
denrase ac9439c
add sample image
denrase fd6c983
Update docs/platforms/dart/common/feature-flags/index.mdx
buenaflor bec3b50
Update includes/dart-integrations/firebase-remote-config.mdx
buenaflor 7685c83
fix typo
denrase d43329e
Merge branch 'master' into denrase/flutter-feature-flags
denrase File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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`. | ||
|
|
||
| ## Enable Evaluation Tracking | ||
|
|
||
| If you use a third-party SDK to evaluate feature flags, you can enable Sentry to track those evaluations. Integrations are provider specific, and documentation for supported SDKs is listed below: | ||
|
|
||
| - [Firebase Remote Config](/platforms/dart/configuration/integrations/firebase-remote-config/) | ||
|
|
||
| ### Manual Usage | ||
|
|
||
| Call `Sentry.addFeatureFlag` to track feature flag evaluations: | ||
|
|
||
| ```dart | ||
| Sentry.addFeatureFlag("feature_flag_a", true); | ||
| ``` | ||
|
|
||
| Calling this function multiple times with the same flag name will override the previous value. | ||
9 changes: 9 additions & 0 deletions
9
docs/platforms/dart/common/integrations/firebase-remote-config.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" /> |
9 changes: 9 additions & 0 deletions
9
docs/platforms/dart/guides/flutter/integrations/firebase-remote-config.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| --- | ||
| 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, providing insight into feature flag evaluations. | ||
|
|
||
| ## 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`. | ||
buenaflor 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. | ||
|
|
||
| ```dart | ||
| await SentryFlutter.init( | ||
| (options) { | ||
| options.addIntegration( | ||
| SentryFirebaseRemoteConfigIntegration( | ||
| firebaseRemoteConfig: firebaseRemoteConfig, | ||
| ), | ||
| ); | ||
| }, | ||
| ); | ||
| ``` | ||
|
|
||
| ### Remote Config Update | ||
|
|
||
| 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 | ||
| SentryFirebaseRemoteConfigIntegration( | ||
| firebaseRemoteConfig: firebaseRemoteConfig, | ||
| activateOnConfigUpdated: false, | ||
| ), | ||
| ``` | ||
|
|
||
| ## Verify & View | ||
|
|
||
| ### 1. Update Firebase Remote Config Value | ||
|
|
||
| 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 their string values are `true`, `false`, `1`, or `0`. So numerical values of `1` or `0` will be evaluated as `true` or `false` boolean values respectively. | ||
|
|
||
| ### 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. | ||
|
|
||
| Flag evaluations will appear in the "Feature Flag" section of Issue Details page as a table, with "suspect" flag predictions highlighted in yellow. | ||
|
|
||
|  | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.