Commit Graph
1 Commits
Author SHA1 Message Date
posthog-eu[bot] d5442136d9 feat: add PostHog analytics integration
Adds opt-in, metadata-only PostHog product analytics to the backend.

- New core/analytics.py singleton: env-driven Posthog client, stable
  per-installation UUID as distinct_id, best-effort capture() no-op when
  disabled/uninitialized.
- Wires setup_posthog()/teardown_posthog() into the FastAPI lifespan.
- Instruments ten events across the user journey (speech_generated,
  generation_failed, voice_profile_created/deleted/locked, model_installed,
  engine_selected, dub_project_started, batch_job_submitted,
  setup_completed).
- Adds posthog>=7.22.1 to dependencies (pyproject.toml + uv.lock).

Analytics stay disabled unless POSTHOG_PROJECT_TOKEN is set, preserving the
local-first, no-telemetry-by-default guarantee.

Generated-By: PostHog Code
Task-Id: a74d5ec7-ac98-4069-9fa0-1b8be460d8a9
2026-07-12 10:22:35 +00:00