Install ppg-js
Install ppg-js from npm or load the browser-global build without a bundler.
Install ppg-js
npm
npm install @sontakey/ppg-jsImport the main camera facade from the package root:
import { PPG } from '@sontakey/ppg-js';The package also exposes focused entry points for the engine, DSP utilities, HRV analysis, and alternate sources:
import { PpgEngine } from '@sontakey/ppg-js/engine';
import { hrv } from '@sontakey/ppg-js';
import * as dsp from '@sontakey/ppg-js/dsp';
import { BleHeartRateSource, ArraySource } from '@sontakey/ppg-js/sources';Browser global
No bundler is required:
<script src="https://unpkg.com/@sontakey/ppg-js/dist/index.global.js"></script>The global build exposes PPG.PPG, PPG.PPGMonitor, PPG.PpgEngine, PPG.hrv, PPG.dsp, and PPG.sources.
Runtime requirements
Camera capture requires HTTPS or localhost and getUserMedia. Call start() from a user gesture. Camera access, wake lock, and motion permission all depend on that gesture.