Why
Amplitude gives you a production-grade analytics pipeline without any infrastructure to manage. You instrument events on the backend, and Amplitude handles ingestion, storage, and visualisation. It’s the right choice when you need funnel analysis, retention metrics, or cohort-based product insights.Setup
- In
apps/backend/src/configuration/production.ts(andstaging.tsif you have one), settools.analytics: - In your production environment, set:
- Keep
development.tsandtest.tsusing thelocalclient — Amplitude should never receive dev or test traffic. - Run
make test module=backend.
Tracking events
Calltools.analytics.track() with an event name, a properties object, and an optional identification object:
snake_case. Keep property keys bounded and low-cardinality where used for filtering.
Gotchas
amplitude.init()is called once at startup insidebuildAmplitudeAnalytics. Do not call it elsewhere.- The node SDK batches and flushes events asynchronously. A process crash before the flush window may drop the last few events — this is expected behaviour for fire-and-forget analytics.
- Never send Amplitude traffic from
development.tsortest.ts— it pollutes your production data and your event quota.
What’s next?
- Local — the dev stub to use in
development.tsandtest.ts. - Configuration — switching pluggable tool implementations.