@radzor/event-tracker
Track user events and page views for analytics. Buffers events in memory and flushes them in batches to a configurable HTTP endpoint. Zero dependencies — uses raw fetch.
Analyticsv0.1.0typescriptpythonUniversalanalyticstrackingeventspageviewmetricstelemetryby Radzor
Install
View source on GitHub →$npx radzor@latest add event-tracker
⚠ Constraints: Events are buffered in memory; if the process crashes before a flush, buffered events are lost. The endpoint must accept POST with a JSON array body. Uses fetch() — in Node.js < 18, a polyfill is required.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| endpoint* | string | — | HTTP endpoint to POST event batches to.EVENT_TRACKER_ENDPOINT |
| batchSize | number | 20 | Number of events to buffer before auto-flushing. |
| flushIntervalMs | number | 5000 | Max time in ms between automatic flushes. |
| headers | Record<string, string> | — | Additional HTTP headers sent with each flush (e.g. auth tokens). |
endpoint*string
HTTP endpoint to POST event batches to.
EVENT_TRACKER_ENDPOINT