Skip to content

Ingestion

The SDK delivers events to a single ingestion endpoint. You normally never call this directly — a connector’s trackScene (via @uptimizr/sdk-core) batches events and sends them for you — but the contract is documented here for custom transports and self-hosting.

Batched events. The SDK uses navigator.sendBeacon (credentialed) and falls back to fetch with keepalive. Authenticate with the project API key.

PropertyValue
MethodPOST
Path/api/v1/collect
Authx-api-key: <project key>
Content-Typeapplication/json
BodyA batch of events, each validated against @uptimizr/schema

Events are validated against the Zod schemas in @uptimizr/schema at the edge; invalid batches are rejected. Every event carries the shared envelope (ordered, timestamped, keyed by sessionId).

  • Batching. @uptimizr/sdk-core flushes when the batch reaches batchSize (default 20) or after flushIntervalMs (default 5000).
  • Beacon first. Sends use navigator.sendBeacon so events survive page unload, falling back to fetch({ keepalive: true }).
  • Privacy. No cookies and no persistent client id; the sessionId is in-memory only.

A scene can register a proxy of its geometry (per-mesh bounding boxes) so the dashboard’s 3D heatmaps draw against a recognizable backdrop. Writes use the same project API key.

MethodPathPurposeBody
PUT/api/v1/scenes/:sceneId/representationRegister/replace a scene proxy. proxy.sceneId must match the path.{ proxy, label? }
Terminal window
curl -X PUT -H "x-api-key: $KEY" -H "content-type: application/json" \
-d '{"proxy": <SceneProxy>, "label": "Main Lobby"}' \
"https://collect.example.com/api/v1/scenes/lobby/representation"

The proxy is produced client-side by scanSceneProxy(scene, { sceneId }) in @uptimizr/babylon.