Use this page if you want the integration model for browser rPPG. If you want numbered steps for an existing app, use Add Camera-Based rPPG To An Existing Browser App. If you want the scaffold path, use Build Your First Elata App.Documentation Index
Fetch the complete documentation index at: https://docs.elata.bio/llms.txt
Use this file to discover all available pages before exploring further.
This is the primary browser biosignal path for most products: no headset required before you ship meaningful signal UX.
- deception or bluffing games that react to pulse changes during key moments
- stress or arousal feedback in training and social experiences
- breathing and relaxation flows that show physiological response over time
- biofeedback-oriented health or wellness apps that want camera-based pulse signals without extra hardware
Install
Recommended vs. Advanced
Recommended:- Use
createRppgSession()for browser apps. - Use
createManagedRppgSession()when you want built-in restart behavior after a terminal processor failure. - Use
createRppgPipeline()from@elata-biosciences/eeg-webonly if you intentionally need low-level sample ingestion.
- Use
RppgProcessor,DemoRunner, custom backends, or generated WASM bindings only if you need custom orchestration and understand the runtime lifecycle already. - If you are not debugging the SDK itself, do not start with generated WASM exports.
Minimal Integration
Typical Integration Flow
- Acquire a camera stream in the browser and attach it to a
videoelement. - Call
createRppgSession({ video, backend: "auto" }). - Read metrics from
session.getMetrics(). - Surface diagnostics from
onDiagnosticsorsession.getDiagnostics(). - Stop the session during cleanup with
await session.stop().
createRppgSession() owns WASM init, FaceMesh loading, frame scheduling, ROI selection, diagnostics, and cleanup.
Use session.state or diagnostics.state to distinguish:
- normal
running - startup fallback or degraded setup via
degraded - terminal runtime processor failure via
failed
faceMesh: "off", the session stays in supported video_frame mode and is not reported as a FaceMesh failure by default.
If your app needs explicit asset paths instead of the default /pkg/* lookup, pass one or more of:
wasmImporter directly.
Managed Restart Flow
If you want the SDK to own restart timing after terminal processor failures, use the managed wrapper:starting, running, retrying, and failed, while still letting apps drop down to the underlying RppgSession when needed.
Advanced Helpers
Trace Snapshots
Trace Snapshots
Use For peak/threshold waveform debug from the trace data, use
getTraceSnapshot() when you need recent waveform or debug points for charts, debug panels, or regression capture:computeTraceWaveformDebug():Error Normalization
Error Normalization
Use This gives apps stable categories such as
normalizeRppgError() instead of parsing raw message text in app code:wasm_init_failed, backend_unavailable, camera_not_playing, and processor_failed.App Adapter
App Adapter
If you want a single app-facing snapshot with restart status, publish gating, trace data, and stable messages, use
createRppgAppAdapter():App Monitor
App Monitor
If you want the SDK to own the recurring snapshot loop too, use
createRppgAppMonitor():Video Playback Helper
Video Playback Helper
createRppgSession() now waits for the video element to start playing by default. If you need to coordinate that step yourself, call ensureVideoPlaying() directly:When To Use The rPPG Template Instead
Prefer the scaffoldedrppg-demo template when you want:
- a known-good browser camera app
- a reference for packaged WASM asset loading
- a faster comparison point when debugging your own integration
Common Gotchas
- If
session.backendModeisunavailable, your app is probably not serving the packagedpkg/assets correctly. - If
session.state.statusisfailed, treat that processor backend as terminal and recreate the session instead of continuing to poll metrics from it. - If you see “backend pipeline has no push_sample API”, you likely bypassed the safe wrapper path. Start with
createRppgSession()for browser apps, orinitEegWasm()pluscreateRppgPipeline()for low-level ingestion. - If you hit
wasmrppgpipeline_new, initialize the WASM module before creating low-level pipelines and avoid calling generated constructors directly. - If you see deprecated init warnings, route startup through
initEegWasm()instead of forwarding raw strings, URLs, or buffers to the generated init exports. - If camera access fails, confirm the page has permission to use
getUserMedia. - If
session.lastErroris non-null, use itscodeandmessageto surface the real capture or processor failure instead of retrying blindly. - If you are just evaluating the SDK, the scaffolded app is much faster than building the whole browser pipeline yourself.
Version Guidance
If you install both
@elata-biosciences/rppg-web and @elata-biosciences/eeg-web, prefer matching versions. They are developed and verified together in the same repo.Next
Existing App Tutorial
Step-by-step rPPG integration
rppg-web Reference
Package API and exports
rPPG Architecture
Pipeline design and components
Troubleshooting
Common failures and fixes