Skip to content

logpane/logpane-flutter-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logpane Flutter SDK

Lightweight analytics and error tracking SDK for Flutter. Privacy-friendly event tracking and error monitoring.

Note: This SDK is in active development and not yet ready for production use. The API may change between versions. Use at your own risk.

Using an AI coding agent? Give your agent this link and it will set up Logpane in your project automatically: https://app.logpane.dev/sdk/integration-guide.txt

Installation

dependencies:
  logpane: ^0.1.0
flutter pub get

Quick Start

import 'package:logpane/logpane.dart';

void main() {
  runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();

    await Logpane.init(
      apiKey: 'YOUR_API_KEY',
      source: 'flutter-mobile',  // Optional: identifies this app in the dashboard
    );

    FlutterError.onError = (details) {
      FlutterError.presentError(details);
      Logpane.instance.captureFlutterError(details);
    };

    PlatformDispatcher.instance.onError = (error, stack) {
      Logpane.instance.captureError(error, stack);
      return true;
    };

    runApp(const MyApp());
  }, (error, stack) {
    Logpane.instance.captureError(error, stack);
  });
}

Screen Tracking

MaterialApp(
  navigatorObservers: [Logpane.instance.navigatorObserver],
);

Custom Events

Logpane.instance.track('purchase', {
  'item': 'sword',
  'price': 9.99,
});

Error Capture

try {
  await riskyOperation();
} catch (e, stack) {
  Logpane.instance.captureError(e, stack,
    context: 'riskyOperation',
  );
}

User Identification

Logpane.instance.identify(user.id, {
  'username': user.name,
});

// On logout
Logpane.instance.reset();

Features

  • Offline event queue (SQLite-backed, events sent when connectivity returns)
  • Automatic error capture across all three Dart error layers
  • Automatic screen tracking via NavigatorObserver
  • Session management with 30-minute background timeout
  • Device metadata (platform, model, OS, app version)
  • Gzip-compressed event batching
  • Multi-source support (tag events with a source identifier for per-platform filtering)
  • Privacy-friendly (no fingerprinting, opt-out toggle)

Configuration

await Logpane.init(
  apiKey: 'YOUR_API_KEY',
  source: 'flutter-mobile',    // Identifies this app/platform in the dashboard
  flushIntervalSeconds: 30,    // How often to send batched events
  maxBatchSize: 50,            // Max events per batch
  maxQueueSize: 1000,          // Max events in offline queue
);

Debug vs Production

The SDK automatically tags every event with an environment field:

  • debug -- when running in debug mode (kDebugMode = true)
  • production -- in release/profile builds

Events are always sent regardless of build mode. You can filter debug data in the Logpane dashboard.

License

MIT

About

Flutter SDK for logpane.dev

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages