TrustNXTTrustNXT
React SDKAPI ReferenceFunctions

useCapture()

Call Signature

function useCapture(opts): CaptureControls;

Primary capture hook — supports both image and audio modes.

Mode is immutable for the lifetime of the component. In image mode, audio fields are null/defaults. In audio mode, camera fields are stubs.

When protection is provided, captured media is automatically queued for cryptographic sealing. The two-event model fires onCapture immediately (raw blob for instant preview) and onProtected/onProtectError once sealing completes/fails — correlated by captureId.

Parameters

ParameterType
optsUseCaptureImageOptions

Returns

CaptureControls

Call Signature

function useCapture(opts): CaptureControls;

Primary capture hook — supports both image and audio modes.

Mode is immutable for the lifetime of the component. In image mode, audio fields are null/defaults. In audio mode, camera fields are stubs.

When protection is provided, captured media is automatically queued for cryptographic sealing. The two-event model fires onCapture immediately (raw blob for instant preview) and onProtected/onProtectError once sealing completes/fails — correlated by captureId.

Parameters

ParameterType
optsUseCaptureAudioOptions

Returns

CaptureControls

On this page