Skip to content

JavaScript SDK 2.2.0

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.2.0.tgz"
bash
yarn add "https://sdk.panoptic.ai/npm/ts-vital-sign-camera-2.2.0.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.2.0.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.2.0.js">

The file vital-sign-camera.umd-2.2.0.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.2.0 (12-Feb-2026)

  • Video file support: VitalSignCamera now supports VideoFile input with playback handling and frame-rate detection. Includes onFrameRateDetected callback and improved error handling for file-based workflows.
  • Persistence API: Added saveScanDataToS3 for optional uploading of request/response payloads to S3 (supports optional encryption).
  • Realtime & diagnostics: Added video information display (frame rate, resolution) and a remote console plugin for remote logging and diagnostics.
  • ROI & performance: ROI extraction refactor to support ImageBitmap for better performance and interop; improved video playback controls and consistent display styling.
  • Tests & CI: Expanded E2E fixtures and automated tests (example18/19), improved video-processing tests and CI verification.
  • Packaging & stability: WASM/asset packaging fixes and UMD/ES builds validated. No breaking API changes; upgrade recommended for improved stability and packaging.