@desert-ant-labs/desert-ant-web
v0.2.0
Published
Internal shared browser/JS code for Desert Ant on-device SDKs (currently: usage reporting — active-device 'load' events to the ingestion API).
Readme
@desert-ant-labs/desert-ant-web
Internal shared web/JS code for Desert Ant's on-device SDKs (shapes, emo, …).
Currently it provides usage reporting: an active-device load event (the MAD
turnstile) sent to our ingestion API.
Not for direct use. This package is published only so our SDKs can depend on it. It has no stable public API and may change without notice — integrate a Desert Ant SDK, not this.
API
import { initUsage } from "@desert-ant-labs/desert-ant-web";
const usage = initUsage(); // keyless: the browser Origin identifies the site
usage.recordCall(); // once per inference; rides the session's load event- One
loadper device per session (30-min idle timeout); the server dedups by device per month and sumscallCountacross events. - Auto-collects low-entropy device context (
locale,osName,osVersion,browserName,browserVersion,formFactor) from User-Agent Client Hints / the UA string — no high-entropy hints, no permission prompt. PassappVersionviacontext(it can't be auto-detected). - Zero dependencies, best-effort, never throws into the host.
initUsage({ key?, endpoint?, callCount?, context?, disabled? })—endpointoverrides the default (e.g. staging).@desert-ant-labs/desert-ant-web/coreexposes the transport/storage-freecreateClient.
Develop
npm run build
npm test # offline unit tests
DAL_LIVE=1 npm test # also hits staging
npm run check:pkg # build + publint + attw