littlefish_analytics_sentry 1.2.0 copy "littlefish_analytics_sentry: ^1.2.0" to clipboard
littlefish_analytics_sentry: ^1.2.0 copied to clipboard

The implementation of littlefish_core for Sentry Analytics

littlefish_analytics_sentry #

The Sentry implementation of the littlefish analytics package for event tracking and user analytics.

Features #

  • Event logging via Sentry breadcrumbs
  • User identification and properties
  • Screen tracking
  • Navigation observer for automatic screen tracking

Getting Started #

Add this package to your pubspec.yaml:

dependencies:
  littlefish_analytics_sentry: ^1.0.0

Usage #

import 'package:littlefish_analytics_sentry/sentry_analytics_service.dart';

// Initialize the service
final analyticsService = SentryAnalyticsService();
await analyticsService.initialize(
  settings: AnalyticsSettings(
    enabled: true,
  ),
);

// Log events
await analyticsService.logEvent(
  e: AnalyticsEvent('button_click', parameters: {'button_id': 'submit'}),
);

// Set user context
await analyticsService.setUserId(userId: 'user123');
await analyticsService.setUserProperty(name: 'plan', value: 'premium');

// Track screens
await analyticsService.setScreenName(name: 'HomeScreen');

// Get navigation observer for automatic screen tracking
final observer = await analyticsService.getAnalyticsObserver();

Note #

Sentry must be initialized before using this service. You can either:

  1. Initialize Sentry via littlefish_observability_sentry first
  2. Initialize Sentry directly in your application using SentryFlutter.init()

If Sentry is not initialized, the service will mark itself as not ready and analytics operations will be skipped.

0
likes
140
points
39
downloads

Publisher

unverified uploader

Weekly Downloads

The implementation of littlefish_core for Sentry Analytics

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, littlefish_core, sentry_flutter

More

Packages that depend on littlefish_analytics_sentry