|
| 1 | +--- |
| 2 | +title: Firebase Remote Config |
| 3 | +description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK." |
| 4 | +sidebar_order: 6 |
| 5 | +platforms: |
| 6 | + - dart |
| 7 | + - flutter |
| 8 | +--- |
| 9 | + |
| 10 | +The `sentry_firebase_remote_config` integration provides [Firebase Remote Config](https://firebase.google.com/docs/remote-config) support for Sentry thus providing insight into feature flag evaluations. |
| 11 | + |
| 12 | +## Behavior |
| 13 | + |
| 14 | +- Adding the `SentryFirebaseRemoteConfig` integration will automatically track feature flag evaluations for boolean Firebase Remote Config values. |
| 15 | +- The integration is available in Sentry SDK version 9.0.0 or higher. |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +1. The Sentry [Dart](/platforms/dart/#configure) SDK is initialized. |
| 20 | +2. Firebase Remote Config is set up. |
| 21 | + |
| 22 | +## Install |
| 23 | + |
| 24 | +To use the `SentryFirebaseRemoteConfig` integration, add the `sentry_firebase_remote_config` dependency. |
| 25 | + |
| 26 | +```yml {filename:pubspec.yaml} |
| 27 | +dependencies: |
| 28 | + sentry: ^{{@inject packages.version('sentry.dart', '9.0.0') }} |
| 29 | + sentry_firebase_remote_config: ^{{@inject packages.version('sentry.dart.firebase_remote_config', '9.0.0') }} |
| 30 | +``` |
| 31 | +
|
| 32 | +## Configure |
| 33 | +
|
| 34 | +Add the `SentryFirebaseRemoteConfig` integration to the Sentry SDK initialization. |
| 35 | + |
| 36 | +```dart |
| 37 | +import 'package:sentry/sentry.dart'; |
| 38 | +import 'package:sentry_firebase_remote_config/sentry_firebase_remote_config.dart'; |
| 39 | +
|
| 40 | +await Sentry.init( |
| 41 | + (options) { |
| 42 | + options.dsn = 'https://[email protected]/example'; |
| 43 | + options.firebaseRemoteConfigIntegration = SentryFirebaseRemoteConfig( |
| 44 | + firebaseRemoteConfig: firebaseRemoteConfig, |
| 45 | + activateOnUpdate: false, // Per default, the remote config is activated on update. You can opt out by setting this to false. |
| 46 | + ); |
| 47 | + }, |
| 48 | +); |
| 49 | +``` |
| 50 | + |
| 51 | +## Verify & View |
| 52 | + |
| 53 | +### 1. Update Firebase Remote Config value |
| 54 | + |
| 55 | +Update a boolean Firebase Remote Config 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. |
| 56 | + |
| 57 | +### 2. View the Recorded Feature Flag Evaluation on Sentry.io |
| 58 | + |
| 59 | +To view the recorded feature flag evaluation, log into [sentry.io](https://sentry.io) and open your project. |
0 commit comments