mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-25 08:37:10 +01:00
@trezor/analytics-docs (Analytics Events Docs)
UI for displaying analytics events from @trezor/analytics-log-server (Live log) and for browsing generated documentation (analytics.json).
The documentation is deployed as static assets via the [Build] analytics-docs workflow (S3 sync). For Live log, you need to run the log server separately (Docker).
What the UI does
- Displays the list of events from
analytics.json(changelog/sections by platform). - Live log connects to the log server via SSE (
/api/analytics-events/stream). - Live log server settings are configured in a UI modal (Settings).
Live log configuration
In Live log inside analytics-docs, open Settings and set:
- Log server base URL (e.g.
http://localhost:5181)
The UI will then:
- read the SSE stream:
BASE_URL/api/analytics-events/stream - send the “custom analytics URL” to Suite:
BASE_URL/log
Suite (web/desktop) sends events to the
/logendpoint as a GET request with query parameters.
Local setup
1) Run the log server in Docker
cd /Users/janvaclavik/dev/trezor-suite
docker build -f packages/analytics-log-server/Dockerfile -t analytics-log-server .
docker run -d --name analytics-log-server \
-p 5181:5181 \
-e PORT=5181 \
analytics-log-server
2) Run the UI (without Docker)
cd /Users/janvaclavik/dev/trezor-suite
yarn workspace @trezor/analytics-docs dev
In your browser, open Live log Settings and set the base URL to http://localhost:5181.
Production deployment
- UI (static assets): deployed by
.github/workflows/build-analytics-docs.yml(S3 sync tos3://*/analytics-docs). - Log server: deployed separately (Docker image from
packages/analytics-log-server/Dockerfile) and must be reachable from the Suite/analytics-docs domain(s) according to your infrastructure.