scoova_monitor 1.5.2
scoova_monitor: ^1.5.2 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.
Symbolicate obfuscated release crashes #
A flutter build --release --obfuscate --split-debug-info=<dir> build
strips Dart symbol names, so a crash on a release build arrives at the
dashboard as _kDartIsolateSnapshotInstructions+0xab234 instead of
CheckoutPage._processOrder. Upload the per-arch .symbols files once
per build and the dashboard runs flutter symbolize server-side:
flutter build apk --release --obfuscate --split-debug-info=build/debug-symbols
# The script is in scripts/scoova-upload-symbols.js inside this package.
# Easiest pattern: copy it into your repo's scripts/ folder once, then:
node scripts/scoova-upload-symbols.js \
--api-key $SCOOVA_API_KEY \
--version $APP_VERSION \
--build $BUILD_NUMBER \
--dir build/debug-symbols
Requires Node on the build machine (ships with macOS by default; on most
CI images already present). No npm install — uses Node stdlib + the
system zip binary.
The script ZIPs every *.symbols file under --dir (so it works for
both Android + iOS in one call) and POSTs to /v1/upload/mapping.
Same upload endpoint as Android (scoova-upload-mapping), iOS
(scoova-upload-dsyms), and Web (scoova-upload-sourcemaps).
License #
Apache 2.0.