Skip to content

JavaScript SDK 2.3.1 ​

Sample Code ​

The quickest and simplest way to kickstart your journey with the JavaScript SDK is by downloading and experimenting with our full-featured sample code:

IMPORTANT

In the above sample codes, the strings __YOUR_USER_ID__ and __YOUR_API_KEY__ should be replaced by your own User ID and API Key repectively. Please contact us to obtain your User ID and API Key.

Installation ​

SDK file installation ​

In your NodeJS project, install the SDK with the npm install or yarn add commands:

bash
npm install "https://sdk.panoptic.ai/npm/ts-vital-sign-camera-2.3.1.tgz"
bash
yarn add "https://sdk.panoptic.ai/npm/ts-vital-sign-camera-2.3.1.tgz"

TIP

If you are using Yarn v2 or later, you might need to include the package name in the command, such as yarn add vital-sign-camera@"https://sdk.panoptic.ai/npm/ts-vital-sign-camera-2.3.1.tgz".

Alternatively, if you are not using NodeJS, you can install the SDK by adding the following line to your main HTML file:

html
<script src="vital-sign-camera.umd-2.3.1.js">

The file vital-sign-camera.umd-2.3.1.js is included in this sample project.

Vite Configuration ​

If you are using Vite as your build tool, you need to exclude ts-vital-sign-camera from dependency optimization to ensure proper functionality:

javascript
// vite.config.js
export default defineConfig({
  optimizeDeps: {
    exclude: ['ts-vital-sign-camera'],
  },
});

Deployment Notes ​

NOTE

If the project is deployed to Google Cloud, some web servers, such as serve, might not function correctly, causing the facial skin age feature to fail. To prevent this issue, use http-server instead.

What's new ​

2.3.1 (28-Oct-2026) ​

  • Fixed the server wake-up failure at camera start: a failed wake-up request no longer surfaces as Uncaught (in promise) TypeError: Failed to fetch at wakeUpServer. The SDK now handles the error and reports it through the existing onError callback as Wake-up request failed: <reason>, so it can be caught and logged by the host application.
  • The wake-up request remains best-effort: scanning is unaffected and proceeds even if the wake-up fails, and real server failures still surface through the normal scan error path.
  • No breaking API changes.

2.3.0 (09-Oct-2026) ​

  • Real-time estimation: enableRealtimeEstimation and realtimeEstimationConfig produce on-device HR/RR estimates during the scan, with estimatorType (Panoptic — default — or MeRppg), signalQualityDelay, minSamples, scanDuration, and visualSignalType. See the realtime estimators guide.
  • Scanning sequence visualization: visualizationOptions.scanningSequence orchestrates the face mesh, bounding box, and thermal mask through an animated scan sequence (horizontal → vertical → ripple sweeps, then a thermal step), with configurable sweepColor, sweepLineWidth, staticLineWidth, staticColor, stepDurations, animationDelay, and an idleStage configuration shown between scans.
  • Thermal mask: visualizationOptions.thermalMask adds a thermal-style overlay tracked to the face ROI, with opacity and colorScheme ('thermal' | 'grayscale').
  • Heatmap visualization: configurable heatmap rendering with built-in colormaps and presets.
  • Face mesh options: new 'ripple' animation direction and simplifyFaceMesh to remove the outer perimeter and surrounding zigzag connections.
  • Age estimation: added AgeEstimationConfig.timeout (default 15 s), plus reliability fixes (age inference in a Web Worker, FaceApi readiness handling).
  • Signal visualizer: respiratory-rate extraction, signalColors, variadic updateSignal, and confidence-based HR colors.
  • Breaking changes: RealtimeEstimatorType.Fda renamed to RealtimeEstimatorType.Panoptic; creation prop realtimeEstimation renamed to enableRealtimeEstimation; minDuration renamed to signalQualityDelay (with unused earlyEstimation/minConfidence fields removed from the realtime estimation config). See the V1 → V2 migration guide if you are upgrading from V1.