respectlytics_flutter 2.0.1
respectlytics_flutter: ^2.0.1 copied to clipboard
Official Respectlytics SDK for Flutter - Privacy-first analytics with session-based tracking. No device identifiers, GDPR/ePrivacy compliant, no consent required.
Respectlytics Flutter SDK #
Official Respectlytics SDK for Flutter. Privacy-first analytics that respects your users.
Features #
- π No device identifiers - No IDFA, GAID, or fingerprinting
- π Automatic session management - Sessions rotate every 2 hours
- πΎ RAM-only storage - Session IDs never written to disk
- ποΈ Auto-cleanup - Uninstall clears all data
- π± Cross-platform - iOS, Android, macOS, Linux, Windows
- β‘ Offline-first - Events queue and sync when online
- πΎ Never lose events - Persisted immediately, survives crashes
- β Designed for GDPR/ePrivacy compliance - Potentially consent-free
Installation #
Add to your pubspec.yaml:
dependencies:
respectlytics_flutter: ^2.0.0
Or run:
flutter pub add respectlytics_flutter
Quick Start #
import 'package:flutter/material.dart';
import 'package:respectlytics_flutter/respectlytics_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// 1. Configure (call once at app launch)
await Respectlytics.configure(apiKey: 'your-api-key');
runApp(MyApp());
}
// 2. Track events anywhere in your app
await Respectlytics.track('purchase', screen: 'CheckoutScreen');
API Reference #
configure(apiKey:) #
Initialize the SDK. Call once in your main() before runApp().
track(eventName, {screen}) #
Track an event with optional screen name. Custom properties are not supported (privacy by design).
flush() #
Force send queued events. Rarely needed - SDK auto-flushes every 30 seconds.
π Automatic Session Management #
Session IDs are managed entirely by the SDK - no configuration needed.
| Scenario | Behavior |
|---|---|
| App starts fresh | New session ID generated |
| App killed & restarted | New session ID (regardless of time) |
| App in foreground 2+ hours | Session ID rotates automatically |
| App in background 2+ hours | Session ID rotates on next track() call |
Key points:
- π New session on every app launch
- β±οΈ Sessions rotate after 2 hours of continuous use
- πΎ Session IDs stored in RAM only (never persisted to disk)
- π« No cross-session tracking - each session is independent
οΏ½οΏ½οΈ Privacy by Design #
Respectlytics is designed to minimize data collection by default. We use anonymized identifiers that are stored only in device memory (RAM) and rotate automatically every two hours or upon app restart. IP addresses are processed transiently for approximate region lookup and immediately discardedβno personal data is ever persisted server-side.
This privacy-by-design architecture avoids persistent device storage and cross-session tracking, significantly reducing compliance complexity compared to traditional analytics. While this approach may reduce or eliminate consent requirements in some jurisdictions, regulations and their interpretation vary. We recommend consulting with your legal team to determine your specific compliance requirements.
| What we DON'T collect | Why |
|---|---|
| IDFA / GAID | Device advertising IDs can track users across apps |
| Device fingerprints | Can be used to identify users without consent |
| IP addresses | Processed transiently for geolocation, never stored |
| Custom properties | Prevents accidental PII collection |
| Persistent user IDs | Would require consent under ePrivacy Directive |
| What we DO collect | Purpose |
|---|---|
| Event name | Analytics |
| Screen name | Navigation analytics |
| Session ID (RAM-only) | Group events within a session |
| Platform, OS version | Debugging |
| App version | Debugging |
| Approximate location | Country/region only (from IP, never stored) |
Event Queue Behavior #
Events are queued and sent automatically:
- Every 30 seconds
- When 10 events are queued
- When app goes to background
- When
flush()is called
Events are NEVER lost: They are persisted to SharedPreferences immediately on every track() call, surviving force-quit, crashes, and app termination.
Platform Support #
| Platform | Supported |
|---|---|
| iOS | β |
| Android | β |
| macOS | β |
| Linux | β |
| Windows | β |
| Web | β |
Requirements #
- Flutter 3.10+
- Dart 3.0+
Migration from v1.x #
β οΈ Breaking Changes #
- REMOVED:
identify()method - no longer needed - REMOVED:
reset()method - no longer needed - REMOVED: SharedPreferences storage for user IDs
What to do #
- Remove any calls to
Respectlytics.identify() - Remove any calls to
Respectlytics.reset() - That's it! Session management is now automatic.
Why this change? #
Storing identifiers on device (SharedPreferences) requires user consent under ePrivacy Directive Article 5(3). In-memory sessions require no consent, making Respectlytics truly consent-free analytics.
Getting Help #
- π SDK Documentation
- π Issue Tracker
- π¬ Support
License #
Proprietary. See LICENSE file.