sentinel_analytics_realm_dart 0.0.3 copy "sentinel_analytics_realm_dart: ^0.0.3" to clipboard
sentinel_analytics_realm_dart: ^0.0.3 copied to clipboard

Dart/Flutter client for Sentinel Analytics Realm HTTP ingestion.

Sentinel Analytics Realm – Dart SDK #

Thin Dart/Flutter client for sending events to the Sentinel Analytics Realm HTTP ingestion API.

Install #

Add to your pubspec.yaml:

dependencies:
  sentinel_analytics_realm_dart: ^0.0.3

Then run dart pub get or flutter pub get.

Usage #

import 'package:sentinel_analytics_realm_dart/sentinel_analytics_realm_dart.dart';

void main() async {
  final client = SentinelAnalyticsRealmPlugin(
    projectId: 'YOUR_PROJECT_ID',
    appId: 'YOUR_APP_ID',
    // baseUrl: 'https://api.sentinelanalyticsrealm.com', // default
    // env: 'prod', // default
  );

  await client.track('page_view', visitorId: 'v_123');

  await client.identify(userId: 'u_456', visitorId: 'v_123', traits: {
    'email': 'user@example.com',
  });

  await client.trackBatch([
    SentinelAnalyticsRealmEvent(name: 'click', visitorId: 'v_123', properties: {'button': 'buy'}),
    SentinelAnalyticsRealmEvent(name: 'hover', visitorId: 'v_123'),
  ]);
}

Environment configuration #

The client can read configuration from environment variables when available (Dart VM/Flutter mobile/desktop). On the web, pass values explicitly.

  • SENTINEL_ANALYTICS_REALM_PROJECT_ID
  • SENTINEL_ANALYTICS_REALM_APP_ID
  • SENTINEL_ANALYTICS_REALM_ENV (defaults to prod)
  • SENTINEL_ANALYTICS_REALM_URL (defaults to https://api.sentinelanalyticsrealm.com)

For Flutter builds you can also use --dart-define and read via String.fromEnvironment, or pass values directly to the constructor.

API #

  • track(name, ...) – sends a single event.
  • trackBatch(List<SentinelAnalyticsRealmEvent>) – sends a batch of events.
  • identify(userId, {visitorId, traits}) – convenience method.

All calls return Future<Map<String, dynamic>?> containing the decoded JSON response or null on error/non-2xx.

Notes #

  • The SDK is lightweight and performs best-effort error handling (no exceptions on HTTP failures by default).
  • For the browser, prefer batching and reusing a single client instance per app.
0
likes
150
points
15
downloads

Documentation

API reference

Publisher

verified publishersavantrealms.com

Weekly Downloads

Dart/Flutter client for Sentinel Analytics Realm HTTP ingestion.

Repository (GitLab)
View/report issues

License

MIT (license)

Dependencies

http, uuid

More

Packages that depend on sentinel_analytics_realm_dart