Files
Jiang Bohan fde3afe289 feat(analytics): add Mixpanel tracking with env-based toggle
Introduces a `features/analytics/` module that wraps the Mixpanel JS SDK.
All tracking is gated behind `NEXT_PUBLIC_MIXPANEL_TOKEN` — when the env
var is absent, every analytics call is a silent no-op, so open-source
users who clone the repo are unaffected.

Core integration points:
- AnalyticsProvider in root layout initializes SDK and tracks page views
- Auth store/initializer: identify on login, reset on logout
- Workspace store: register super properties on workspace hydrate/switch
- Login page: track login_started on OTP request
- Create issue modal: track issue_created with metadata

Also adds event name constants (events.ts) and user profile helpers
(identifyUser, incrementUserProperty).
2026-04-03 15:35:58 +08:00
..