Skip to content
pubscout

posthog_flutter

5.61.1, released 3 days ago by posthog.com

Flutter client for PostHog analytics, feature flags, and session replay

$ flutter pub add posthog_flutter
Source repository

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.

  • supabase

    Dart client for Supabase, usable in non-Flutter Dart environments.

  • firebase_database

    Flutter plugin for Firebase Realtime Database with offline access and realtime syncing.

  • postgrest

    Dart client library offering an ORM‑like interface to PostgREST/Supabase databases.

Works with

Packages commonly used together with posthog_flutter: ones it builds on, ones built on it, and its own family.