Skip to main content

Overview

@elata-biosciences/app-metrics gives your app a per-user store for event records and scores, plus reportAffect for contributing to the user’s cross-app biometric Score.
Data is scoped to the (user, app) pair and never crosses app boundaries. Elata keeps a local copy and, for signed-in users, syncs it to the user’s account so it follows them across devices. These records also power your analytics.

API

Limits

  • Each record can be up to 64 KB.
  • Each (user, app) pair has a 5 MB storage quota.
  • Calls fail with quota_exceeded, invalid_payload, or rate_limited when you exceed limits.
Errors are thrown as MetricsClientError, whose code is one of the host codes above or handshake_timeout, disposed, or transport.

reportAffect

reportAffect sends a derived session result, never raw signal, to Elata so it can contribute to the user’s cross-app biometric Score.
Two things must be true or the call fails with scope_denied:
  1. Your app has the biometrics scope. Contact the Elata team to enable it for your app.
  2. The user has consented. Ask with elata:consent:request. Elata also re-checks consent on the server for every sample.

For hosts

The package also ships a host entry, @elata-biosciences/app-metrics/host (createMetricsHost), used by Elata itself. App developers don’t need it.