Skip to content

TypeScript SDK Reference / VitalSignCameraInterface

Interface: VitalSignCameraInterface ​

Defines the Vital Sign Camera, the main component for doing vital sign scanning. This component is created by the function createVitalSignCamera and provides the primary interface for controlling camera-based vital sign measurement.

Example ​

ts
// Create and setup the camera
const camera = createVitalSignCamera({
  isActive: true,
  userInfo: userData,
  onVideoFrameProcessed: handleFrame
});

// Bind to video element
camera.bind(document.getElementById('video'));

// Start scanning
camera.startScanning();

Properties ​

boundingBoxElement? ​

readonly optional boundingBoxElement: HTMLElement

HTML element for bounding box overlay.


config ​

config: VitalSignEngineConfig

The configuration of the vital sign engine.


customConditionRange? ​

optional customConditionRange: CustomConditionRange

Deprecated ​

Custom condition ranges.


device? ​

optional device: string

The device ID of the currently selected camera.


faceDetectionRegion? ​

optional faceDetectionRegion: FaceDetectionRegion

Region used for face detection.


faceDetectionSamplingInterval? ​

readonly optional faceDetectionSamplingInterval: number

Sampling interval for face detection results.


faceDetectorType ​

readonly faceDetectorType: FaceDetectorType

Type of face detector being used.


faceMeshElement? ​

readonly optional faceMeshElement: HTMLElement

HTML element for face mesh overlay.


grabbedFrames? ​

readonly optional grabbedFrames: GrabbedFrame[]

Frames grabbed by the frame grabber.


isActive ​

isActive: boolean

Whether the camera is currently active.


maxFaceDetectionFps ​

readonly maxFaceDetectionFps: number

Maximum frame rate for face detection.


maxFps ​

maxFps: number

Maximum frame rate for processing.


modelLoadingProgressElement? ​

readonly optional modelLoadingProgressElement: HTMLElement

HTML element for model loading progress overlay.


onCameraDevicesUpdated()? ​

optional onCameraDevicesUpdated: (event) => void

Callback for camera devices updated events.

Parameters ​

event ​

CameraDevicesUpdatedEvent

Returns ​

void


onError()? ​

optional onError: (error) => void

Callback for error events.

Parameters ​

error ​

unknown

Returns ​

void


onInitialized()? ​

optional onInitialized: () => void

Callback for initialization completion.

Returns ​

void


onModelLoadingProgress()? ​

optional onModelLoadingProgress: (progress) => void

Callback for model loading progress events.

Parameters ​

progress ​

ModelLoadingProgressEvent

Returns ​

void


onPrecisionModeUpdated()? ​

optional onPrecisionModeUpdated: (event) => void

Callback for precision mode updated events.

Parameters ​

event ​

PrecisionModeUpdatedEvent

Returns ​

void


onPrecisionModeWillUpdate()? ​

optional onPrecisionModeWillUpdate: (event) => void

Callback for precision mode will update events.

Parameters ​

event ​

PrecisionModeWillUpdateEvent

Returns ​

void


onVideoFrameProcessed()? ​

optional onVideoFrameProcessed: (event) => void

Callback for video frame processed events.

Parameters ​

event ​

VideoFrameProcessedEvent

Returns ​

void


onVideoSettingsUpdated()? ​

optional onVideoSettingsUpdated: (event) => void

Callback for video settings updated events.

Parameters ​

event ​

VideoSettingsUpdatedEvent

Returns ​

void


precisionMode? ​

optional precisionMode: PrecisionMode

The current precision mode.


presetFormat ​

presetFormat: PresetFormat

Current camera resolution preset.


realtimeEstimationConfig? ​

optional realtimeEstimationConfig: RealtimeEstimationConfig

Configuration for realtime estimation.


sdkCredentials? ​

optional sdkCredentials: SdkCredentials

SDK credentials for API access.


thermalMaskElement? ​

readonly optional thermalMaskElement: HTMLElement

HTML element for thermal mask overlay.


transform ​

readonly transform: TransformXStyle

Current X-transform style applied to the video.


userInfo ​

userInfo: UserInfo

Information about the user being scanned.


version ​

readonly version: string

The version of the component.


videoSettings? ​

readonly optional videoSettings: VideoSettings

Current video settings.


visualizationOptions? ​

optional visualizationOptions: VisualizationOptions

Visualization options for overlays.

Methods ​

bind() ​

bind(video): void

Bind the camera to an HTML video element.

Parameters ​

video ​

HTMLVideoElement

Returns ​

void


destroy() ​

destroy(): Promise<void>

Destroy the camera instance and clean up all resources.

Returns ​

Promise<void>


getLastRequestV2() ​

getLastRequestV2(): string | undefined

Get the last request sent to the backend during scan/analyze flow (encrypted base64 on V2 servers only). Throws "not supported on V1/legacy servers" error if called on V1 mode.

Returns ​

string | undefined


getLastResponseV2() ​

getLastResponseV2(): string | undefined

Get the last response received from the backend during scan/analyze flow (encrypted base64 on V2 servers only). Throws "not supported on V1/legacy servers" error if called on V1 mode.

Returns ​

string | undefined


saveScanDataToS3() ​

saveScanDataToS3(bucket, requestDirectory?, responseDirectory?, shouldEncrypt?): Promise<{ request: any; response?: any; }>

Parameters ​

bucket ​

string

requestDirectory? ​

string

responseDirectory? ​

string

shouldEncrypt? ​

boolean

Returns ​

Promise<{ request: any; response?: any; }>


startScanning() ​

startScanning(): void

Start the vital sign scanning process.

Returns ​

void


stopScanning() ​

stopScanning(): void

Stop the scanning process.

Returns ​

void


waitCameraToStop() ​

waitCameraToStop(timeoutMS?): Promise<boolean>

Wait for the camera to stop completely.

Parameters ​

timeoutMS? ​

number

Returns ​

Promise<boolean>