scoova_monitor 1.5.1
scoova_monitor: ^1.5.1 copied to clipboard
Scoova Monitor SDK for Flutter — crash reporting, analytics, performance, battery tracking, and logging
Scoova Monitor — Flutter SDK #
Crash reporting, analytics, performance, and battery monitoring for Flutter 3.0+ apps on iOS and Android.
Install #
Add to pubspec.yaml:
dependencies:
scoova_monitor: ^1.5.1
Then:
flutter pub get
Usage #
Initialize before runApp:
import 'package:flutter/material.dart';
import 'package:scoova_monitor/scoova_monitor.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await ScoovaMonitor.init('sm_your_api_key');
runApp(const MyApp());
}
To capture zone errors as well, wrap runApp in runZonedGuarded:
import 'dart:async';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await ScoovaMonitor.init('sm_your_api_key');
runZonedGuarded(() {
runApp(const MyApp());
}, (error, stack) {
// Already captured by ScoovaMonitor's PlatformDispatcher.onError hook,
// but you can rethrow or log here if you want a second handler.
});
}
Configuration #
await ScoovaMonitor.init(
'sm_your_api_key',
endpoint: 'https://monitor.scoo-va.info', // self-hosted? change this
);
The Flutter SDK does not collect approximate location and does not probe for third-party SDKs — see the SDK documentation for the full collection inventory.
API #
Identify the user #
ScoovaMonitor.setUserId('user_123');
The user ID is hashed before it leaves the device. Without setUserId
the SDK falls back to an anonymous installation ID.
Track events #
ScoovaMonitor.trackEvent('checkout_started', data: {
'plan': 'annual',
'amount': '29.99',
});
Track screens #
ScoovaMonitor.trackScreen('ProductDetail');
Or wire the navigator observer into your MaterialApp for automatic
screen tracking:
MaterialApp(
navigatorObservers: [ScoovaMonitor.routeObserver],
// …
)
Capture errors #
FlutterError.onError, isolate errors, and PlatformDispatcher.onError
are captured automatically.
For non-fatal errors:
try {
await riskyWork();
} catch (e, stack) {
ScoovaMonitor.captureError(e, stack);
}
Breadcrumbs #
ScoovaMonitor.addBreadcrumb('Started photo upload', 'media');
Tagged loggers #
final log = ScoovaMonitor.logger('payment');
log.info('Started checkout', data: {'amount': '29.99'});
log.error('Card declined', data: {'code': 'card_declined'});
Right-to-erasure (GDPR / CCPA) #
await ScoovaMonitor.clearLocalUserData();
Wipes the on-disk event/log/metric queues, the pending crash file,
breadcrumbs, the anonymous installation ID, the session counter, and the
user ID. Pair with a server-side DELETE /v1/ingest/me/{userId}.
Manual flush #
await ScoovaMonitor.flush();
The SDK auto-flushes every 5 minutes, on lifecycle pause, and when the batch threshold is hit — manual flush is rarely needed.
License #
Apache 2.0.