atrixANALYTICS
SDKs

SDKs

Every Atrix SDK shares one behaviour spec. Pick your platform.

PlatformPackageEventsFlagsReplayStatus
Web@atrix.dev/analytics-webyesyesrrweb, lazy-loadedAvailable
React@atrix.dev/analytics-webyesyesyesVia the web SDK
React Native / Expo@atrix.dev/analytics-react-nativeyesyesnative wireframesAvailable
Node.js and Bun@atrix.dev/analytics-nodeyeslocal evaluation—Available
Pythonatrix-analyticsyeslocal evaluation—Available
Gogithub.com/atrixdigital/atrix-analytics/sdks/goyeslocal evaluation—Available
posthog-js shim@atrix.dev/posthog-compatyesyesyesAvailable
iOSAtrixReplay (Swift Package)——native wireframesReplay only
Androiddev.atrix:replay——native wireframesReplay 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_events event 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. granted sends. pending holds events in memory and writes nothing. denied sends nothing and wipes stored state. Browsers also have a cookieless mode.
  • Identity. identify is one-way, reset starts a new anonymous identity, and there is no client alias: see Identity.
  • Hooks. beforeSend can 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.

On this page