TrustNXTTrustNXT
React SDKAPI ReferenceFunctions

useKeepAwake()

function useKeepAwake(): void;

Keeps the screen awake using the Web Screen Wake Lock API.

Handles "The requesting page is not visible" errors gracefully and automatically re-acquires the lock on visibility change.

Returns

void

Example

function CameraPage() {
  useKeepAwake();
  const capture = useCapture({ mode: "image", apiKey: "..." });
  // ...
}

On this page