posthog_flutter
5.61.1, released 3 days ago by posthog.com
Flutter client for PostHog analytics, feature flags, and session replay
What it does
Sends events, identifies users, tracks sessions, and supports feature flags and session replay across iOS, Android, Web, macOS, Windows, and Linux.
AI-written summary of version 5.60.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need analytics and feature flag support in a Flutter app
- You want session replay for debugging
- You target multiple platforms including desktop
Skip it when
- You only need simple logging or a lightweight analytics SDK
- You are building a web‑only app and prefer a pure web solution
Strengths
- Cross‑platform support (mobile, web, desktop)
- Built‑in feature flag handling
- Session replay and crash capture on mobile
- Easy to set up with a single setup call
Weaknesses
- Desktop support is experimental and limited to core analytics
- No push notification or survey support on desktop
- Requires native platform setup for path_provider
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Add dependency, import package, call `Posthog().setup(config)` in main, optionally set `config.enableWindowsAndLinux = false` for desktop disable.
```dart
import 'package:posthog_flutter/posthog_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Posthog().setup(PostHogConfig(
projectToken: 'YOUR_TOKEN',
host: 'https://app.posthog.com',
));
runApp(MyApp());
}
```Alternatives
Packages that do the same job and could replace posthog_flutter.
- googleapis
Auto-generated client libraries for accessing Google APIs.
95Compare - supabase
Dart client for Supabase, usable in non-Flutter Dart environments.
92Compare - firebase_database
Flutter plugin for Firebase Realtime Database with offline access and realtime syncing.
91Compare - postgrest
Dart client library offering an ORM‑like interface to PostgREST/Supabase databases.
88Compare
Works with
Packages commonly used together with posthog_flutter: ones it builds on, ones built on it, and its own family.
- stack_traceposthog_flutter depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- webposthog_flutter depends on itLightweight bindings for browser APIs via JS interop
- plugin_platform_interfaceposthog_flutter depends on itReusable base class for platform interfaces of Flutter federated plugins.
- path_provider_windowsposthog_flutter depends on itWindows implementation of the path_provider plugin