sentry 4.0.0-alpha.2 sentry: ^4.0.0-alpha.2 copied to clipboard
A crash reporting library for Dart that sends crash reports to Sentry.io. This library supports Dart Native, and Flutter for mobile, web, and desktop.
Sentry SDK for Dart and Flutter #
package | build | pub | likes | popularity | pub points |
---|---|---|---|---|---|
sentry |
Versions
Versions ^4.0.0
are Prereleases
and are under improvements/testing.
The current stable version is the Dart SDK, 3.0.1.
Usage
-
Sign up for a Sentry.io account and get a DSN at http://sentry.io.
-
Follow the installing instructions on pub.dev.
-
The code snippet below reflects the latest
Prerelease
version. -
Initialize the Sentry SDK using the DSN issued by Sentry.io:
import 'dart:async';
import 'package:sentry/sentry.dart';
Future<void> main() async {
await Sentry.init((options) {
options.dsn = 'https://example@sentry.io/add-your-dsn-here';
// For better groupping, change the 'example' below with your own App's package.
options.addInAppInclude('example');
});
try {
aMethodThatMightFail();
} catch (exception, stackTrace) {
await Sentry.captureException(
exception,
stackTrace: stackTrace,
);
}
}
void aMethodThatMightFail() {
throw null;
}
Flutter SDK Integration
- Check out the Flutter SDK with the Native integrations (Android/Apple).