What problem does it solve?
FastAPI applications often struggle to implement consistent analytics, event tracking, and error monitoring in a scalable way. This skill provides a structured approach to integrating PostHog with FastAPI, enabling standardized instrumentation, lifecycle management, and clear guidance for responsible data capture and user identification.
Core Features & Use Cases
- Automated startup/shutdown lifecycle management to initialize and flush PostHog.
- Context-aware event capture and user identification across FastAPI routes.
- Support for feature flags, error tracking, and basic user profiling to drive data-driven decisions.
- Use Case: Quickly instrument a new or existing FastAPI service to track key events like user signups, logins, and errors with minimal code changes.
Quick Start
Configure environment variables for POSTHOG_PROJECT_TOKEN and POSTHOG_HOST, install dependencies, and run the FastAPI app to verify analytics.