SDKs
SDKs
Every Atrix SDK shares one behaviour spec. Pick your platform.
| Platform | Package | Events | Flags | Replay | Status |
|---|---|---|---|---|---|
| Web | @atrix.dev/analytics-web | yes | yes | rrweb, lazy-loaded | Available |
| React | @atrix.dev/analytics-web | yes | yes | yes | Via the web SDK |
| React Native / Expo | @atrix.dev/analytics-react-native | yes | yes | native wireframes | Available |
| Node.js and Bun | @atrix.dev/analytics-node | yes | local evaluation | — | Available |
| Python | atrix-analytics | yes | local evaluation | — | Available |
| Go | github.com/atrixdigital/atrix-analytics/sdks/go | yes | local evaluation | — | Available |
| posthog-js shim | @atrix.dev/posthog-compat | yes | yes | yes | Available |
| iOS | AtrixReplay (Swift Package) | — | — | native wireframes | Replay only |
| Android | dev.atrix:replay | — | — | native wireframes | Replay only |
All SDKs are MIT licensed and versioned 0.1.0. They are published with the public launch; until then we
share them on request.
One behaviour spec
Every SDK passes the same conformance suite (sdks/spec in the repository), so they behave the same way:
- A UUIDv7 per event, made once. A retry resends the same id and ingest drops the duplicate, so a retry never counts twice.
- Batching. A flush at 20 events, every 30 seconds, and on shutdown. At most 100 events per request and one request in flight. Bodies are gzipped.
- A bounded queue. At most 1,000 events or 5 MB. When it is full the oldest events go first, and the
loss is reported in a
$dropped_eventsevent rather than disappearing silently. - Retries. Network errors, timeouts, 408, 429 and 5xx back off exponentially with jitter and honour
Retry-After. A 413 splits the batch. Any other 4xx drops it. - Consent.
grantedsends.pendingholds events in memory and writes nothing.deniedsends nothing and wipes stored state. Browsers also have a cookieless mode. - Identity.
identifyis one-way,resetstarts a new anonymous identity, and there is no clientalias: see Identity. - Hooks.
beforeSendcan edit or drop any event, and a property denylist strips keys after it. - Never throws. No method throws, and a missing or invalid key turns the SDK into a silent no-op, so analytics can never take your app down.
Money and ids
Send money as integer minor units with an ISO 4217 currency ({ amount: 1999, currency: "AED" } for AED 19.99).
Use your own user id as the distinct id, never an email address or a phone number. Junk ids such as guest,
null, anonymous or 0 are refused, because they would merge unrelated people.