Use this page if you already have a browser app and want the recommended existing-app integration path. If you want the scaffold path instead, use Quickstart. If you only need the mental model first, use rPPG In A Browser App. This tutorial shows the recommended app integration path forDocumentation Index
Fetch the complete documentation index at: https://docs.elata.bio/llms.txt
Use this file to discover all available pages before exploring further.
@elata-biosciences/rppg-web.
Camera rPPG is the primary browser integration for many Elata products. No headset required.
The core idea is simple: let createRppgSession() own the browser runtime, video processing loop, and diagnostics while your app owns the UI.
This is the usual next tutorial after Build Your First Elata App when you choose the existing app branch for camera rPPG. If you are extending the scaffold instead, stay on rppg-demo and use rPPG In A Browser App plus rppg-web.
What You Will Build
You will:- install
@elata-biosciences/rppg-web - request camera access
- attach the stream to a
videoelement - start
createRppgSession() - read metrics and diagnostics
- stop the session during cleanup
Step 1: Install The Package
Step 2: Prepare A Video Element
Your app needs avideo element that can receive the camera stream.
index.html (or your component markup)
autoplayso playback can start once the stream is attachedplaysinlinefor mobile browser behaviormutedto keep autoplay rules out of the way
Step 3: Acquire Camera Access
camera setup
Step 4: Start createRppgSession()
rPPG session
- packaged WASM backend init
- frame capture
- ROI/session orchestration
- diagnostics emission
- cleanup support
Step 5: Read Metrics In Your UI
Step 6: Clean Up Correctly
When the component, route, or page is leaving, stop the session and release the camera stream. Run these in order (samesession and stream as above):
Full example (single paste)
Use this when you want one file to drop into a Vite + React app (for example replace the contents ofsrc/App.tsx). It includes camera setup, session start, and cleanup on unmount.
App.tsx
ref on <video> instead of getElementById("camera") from the steps above.
What To Do With Diagnostics
The quickest useful app behavior is:- show whether the session is
running,degraded, orfailed - display human-readable guidance when
issuesappear - block publishing or scoring until your app has enough stable samples
createManagedRppgSession()createRppgAppAdapter()createRppgAppMonitor()
createRppgSession() first.
Common Problems
session.getDiagnostics().backendModeisunavailable: your app is likely not loading the packaged WASM assets correctly- Camera access fails: check browser permissions and
getUserMediasupport - The session reaches terminal
failed: recreate the session instead of trying to keep using the same poisoned processor - You are trying to debug lower-level generated bindings first: start with
createRppgSession()unless you are intentionally debugging the SDK itself
Next
rppg-web Reference
Package API and exports
rPPG In A Browser
Integration overview
Build Your First App
Best first-time setup path