farol 0.1.2
farol: ^0.1.2 copied to clipboard
Grafana-Faro-compatible Real User Monitoring (RUM) client for Dart, with first-class gRPC support.
// Minimal usage example for `farol`. See ../README.md for the auth model.
import 'package:farol/farol.dart';
Future<void> main() async {
Faro.initialize(
FaroConfig(
collectorUrl: Uri.parse('https://faro-collector.example.com/collect'),
app: const FaroApp(name: 'example-app', version: '1.0.0'),
headersProvider: () async => {'x-api-key': 'replace-me'},
),
);
Faro.instance.pushEvent('app_started');
Faro.instance.pushMeasurement('startup', {'duration_ms': 420});
Faro.instance.setUser(id: 'opaque-user-id');
await Faro.shutdown();
}