analytics_routes
analytics_routes
¶
Small router exposing the anonymous analytics identity to the frontend.
The Tauri desktop app and web frontend need the same anon_id that
the backend and install.sh use so that all events tie to one person.
This endpoint returns that ID (generating it on first call) plus the
public PostHog project key and host so the frontend can initialise
posthog-js against the same project.
Public API — no auth required because the data returned is exactly what the frontend would ship to PostHog anyway. The project key is a public token, not a secret.
Functions¶
get_identity
¶
Return the analytics identity for the current install.
If analytics is disabled in config, still return a
structurally valid response with enabled=False so the frontend
can decide what to do; never throw.