Skip to main content

What is rPPG?

Remote photoplethysmography (rPPG) extracts heart rate from subtle color changes in facial skin captured by a standard camera. No contact sensor is needed, just a webcam.

When To Use This Package

Use @elata-biosciences/rppg-web when your app needs:
  • camera-based biosignal processing in the browser
  • a higher-level rPPG session API instead of raw WASM orchestration
  • diagnostics and app-facing helpers around rPPG sessions

Installation

Requirements: Node.js 20+, browser with camera access and WebAssembly support.
For most browser apps, start with createRppgSession(). It handles WASM init, frame capture, ROI orchestration, diagnostics, and cleanup.
Use createManagedRppgSession() if you also want automatic restart after terminal processor failures.

Diagnostics Guidance

Every session diagnostics payload includes state, issue codes, sampling stats, and processor failure information.
  • If session.state.status becomes failed, treat the underlying processor as terminal and recreate the session.
  • If backend: "auto" falls back to an unavailable backend mode, diagnostics report that state instead of failing silently.

Advanced: RppgProcessor

For custom orchestration, drop to RppgProcessor directly. Only use this when you need something createRppgSession() does not provide. If you are debugging, compare against createRppgSession() first.

Constructor

Pushing Samples

Metrics


Output and quality guidance

For consumer apps, retain face tracking (faceMesh: "auto", or omit the option) unless you deliberately need the video-frame fallback. The examples above use "off" to make the fallback explicit; that mode does not locate facial skin regions. The current SDK source also provides CaptureConfidenceScorer: motion and lighting confidence for capture and calibration, separate from pulse-domain confidence. Use quality and publish gating rather than presenting every numeric estimate as reliable. Advanced source APIs include baseline-relative physiology features, generic activation/recovery interpretation, optional waveform reconstruction, and experimental morphology proxies. A physiology activation score is not emotional valence, facial affect, a stress diagnosis, or a clinical measurement. Face-derived affect is a separate API. Learned waveform reconstruction requires a caller-supplied model artifact and remains an optional diagnostic path. These APIs should be tied to the package release actually installed; current repository source can contain features newer than the npm release. See the current package README.

Key Exports

  • createRppgSession
  • createManagedRppgSession
  • RppgProcessor
  • loadWasmBackend
  • createRppgAppAdapter
  • createRppgAppMonitor
  • normalizeRppgError
  • computeTraceWaveformDebug
  • ensureVideoPlaying

Next

rPPG Existing App Tutorial

Step-by-step integration guide

Frame Sources

MediaPipe face detection and camera capture

Calibration

Muse fusion and calibration models

Camera Integration Guide

End-to-end rPPG setup