sentry_firebase_remote_config 9.0.0-beta.2 copy "sentry_firebase_remote_config: ^9.0.0-beta.2" to clipboard
sentry_firebase_remote_config: ^9.0.0-beta.2 copied to clipboard

Sentry integration to use feature flags from Firebase Remote Config.


===========


Sentry integration for firebase_remote_config package #

package build pub likes popularity pub points
sentry_firebase_remote_config build pub package likes popularity pub points

Integration for firebase_remote_config package. Track changes to firebase boolean values as feature flags in Sentry.io

Usage

  • Sign up for a Sentry.io account and get a DSN at https://sentry.io.

  • Follow the installing instructions on pub.dev.

  • Initialize the Sentry SDK using the DSN issued by Sentry.io.

  • Call...

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_remote_config_example/home_page.dart';
import 'package:flutter/material.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:sentry_firebase_remote_config/sentry_firebase_remote_config.dart';

import 'firebase_options.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

  final remoteConfig = FirebaseRemoteConfig.instance;
  await remoteConfig.setConfigSettings(RemoteConfigSettings(
    fetchTimeout: const Duration(minutes: 1),
    minimumFetchInterval: const Duration(hours: 1),
  ));

  await SentryFlutter.init(
    (options) {
      options.dsn = 'https://example@sentry.io/add-your-dsn-here';

      final sentryFirebaseRemoteConfigIntegration = SentryFirebaseRemoteConfigIntegration(
        firebaseRemoteConfig: remoteConfig,
        // Don't call `await remoteConfig.activate();` when firebase config is updated. Per default this is true.
        activateOnConfigUpdated: false,
      );
      options.addIntegration(sentryFirebaseRemoteConfigIntegration);
    },
  );

  runApp(const RemoteConfigApp());
}

class RemoteConfigApp extends StatelessWidget {
  const RemoteConfigApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Remote Config Example',
      home: const HomePage(),
      theme: ThemeData(
        useMaterial3: true,
        primarySwatch: Colors.blue,
      ),
    );
  }
}

Resources

  • Flutter docs
  • Dart docs
  • Discussions
  • Discord Chat
  • Stack Overflow
  • Twitter Follow
0
likes
160
points
386
downloads

Publisher

unverified uploader

Weekly Downloads

Sentry integration to use feature flags from Firebase Remote Config.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

firebase_remote_config, flutter, sentry

More

Packages that depend on sentry_firebase_remote_config