Skip to content

Configuration reference

Every option on this page is accepted by both trackScene(scene, options) and the lower-level babylonCollector(options). The same names apply across connectors (the engine-specific arguments — camera, renderer, canvas — differ; see each connector page).

trackScene(scene, {
projectId: "your-project-id",
endpoint: "https://collect.example.com",
// ...everything below is optional
});
OptionTypeDefaultEffect
projectIdstringRequired. Your project id (routes data to the right project).
endpointstringRequired. Base URL of your collector.
metaobjectExtra session_start context: sceneId, url, pageMeta.
sceneDescriptionstringFree-text description of the scene, surfaced on the session.
userobjectOpt-in, anonymized user descriptor (user.id pseudonymous/hashed; user.traits non-identifying). See sessions.
OptionDefaultEffect
cameraactive cameraWhich camera the pose/view-direction timeline records. Set explicitly for multi-camera scenes (insets, split-screen, render targets) — otherwise the “active” camera is ambiguous.

A per-channel rate dial for the continuous channels. Each rate is a positive number (Hz), "frame" (every render tick), or 0 (off).

sampling: {
camera: 10, // 10 Hz camera pose
pointerMove: 60, // 60 Hz pointer movement
perf: 0.5, // a perf sample every 2 s
// perSource: { leftController: 30, rightHand: 30 }, // XR
// nodes / bones — scene actors, see Mesh & object tracking
}

Omitted channels keep conservative defaults (≈1 Hz camera, ≈4 Hz pointer, ≈0.5 Hz perf). There is no enforced ceiling — higher fidelity just costs more storage. Discrete events (clicks, button up/down, mesh interactions, scene changes, session start/end, custom, input actions, and the lifecycle events) are always captured at 100% and cannot be rate-limited.

A matching sampling channel overrides these:

OptionDefaultEffect
sampleCameraMs1000Camera-pose sampling interval.
samplePerfMs2000Perf (FPS) sampling interval.
pointerMoveThrottleMs250Minimum gap between pointer_move samples.
OptionDefaultEffect
suppressIdleSamplestrueSkip timer-based camera samples while the pose is unchanged (first is always emitted).
cameraEpsilon1e-3Max per-axis pose change treated as “unchanged”.
suppressIdlePerfSamplesfalseDedupe frame_perf while FPS is steady. Off because a stable FPS is meaningful telemetry.
perfFpsThreshold1Max FPS change treated as “unchanged” (only when suppressIdlePerfSamples is on).
OptionDefaultEffect
capture.cameratrueCamera-pose / view-direction samples.
capture.pointerMovetrueContinuous pointer movement (pointer_move).
capture.clickstrueClick / tap events (pointer_click).
capture.buttonstruePointer down/up (pointer_down / pointer_up).
capture.meshPickstrueMesh interactions (mesh_interaction).
capture.perftrueFrame performance (frame_perf).
capture.contextLosstrueWebGL/WebGPU context_lost / context_restored.
capture.compileStalltrueShader compile stalls (compile_stall, Babylon only).
capture.hoverDwellfalseHover-hesitation capture (hover_dwell). See mesh tracking.
capture.resourceSamplefalseGPU/memory footprint (resource_sample). See performance.
capture.gazefalseWorld-space gaze (camera_sample.hitPoint/hitMesh). See performance.

meshVisibility, hoverDwell, resourceSample, and gaze also take an options object to tune them — documented on the mesh tracking and performance pages.

OptionDefaultEffect
captureLifecycletrueEmit viewport_resize / focus_change / visibility_change.
resizeDebounceMs250Debounce window for viewport_resize.
captureErrorsfalseOpt-in runtime_error capture; not auto-redacted.
jankFrameMs50A rendered frame slower than this counts toward frame_perf.longFrames.
batchSize20Events buffered before an early network flush.
flushIntervalMs5000Max time between network flushes. 0 disables the timer.
transportbeacon → fetchCustom delivery function (e.g. to observe sends).
disabledfalseCollect nothing — e.g. to honor Do-Not-Track.
debugfalseConsole debug logs.

How often events are sent. Every connector batches all event types into one request and flushes on whichever comes first: the queue reaching batchSize, or flushIntervalMs elapsing (plus an immediate flush on page unload). Raise flushIntervalMs (or batchSize) to send fewer, larger requests; lower it for fresher data (e.g. live dashboards). These are forwarded to @uptimizr/sdk-core by trackScene, so they work identically across the Babylon, three.js, and PlayCanvas connectors.

trackScene is the one-call path. For a custom transport, a beforeSend hook (inspect / modify / drop each event — return null to drop), or registering multiple collectors on one session, build the UptimizrClient yourself:

import { UptimizrClient } from "@uptimizr/sdk-core";
import { babylonCollector, readDeviceCaps, readSceneMeta } from "@uptimizr/babylon";
const client = new UptimizrClient({
projectId: "your-project-id",
endpoint: "https://collect.example.com",
beforeSend: (event) => (event.type === "pointer_move" ? null : event), // drop a channel, redact a field, sample
});
client.use(babylonCollector({ scene }));
client.start({ device: readDeviceCaps(scene), scene: readSceneMeta(scene) });

beforeSend runs on every event after the envelope is filled in — it’s the right place to redact error fields or sample a noisy channel. It is not exposed through trackScene; reach for the custom-client path when you need it.

No cookies, no persistent client id; the sessionId is in-memory only. Never put PII in meta, track props, or user (user.id must be pseudonymous/hashed). Per-session raw retention (needed for replay) is opt-in on the collector via ENABLE_RAW_SESSION_RETENTION=true.