Sensitive Screens¶
Part of the Human Scoring use case.
Pause capture while sensitive input is on screen, such as a password, a card number or a one-time code. While paused, the SDK records nothing. The session continues, and capture picks up where it left off when you resume.
When to use it¶
- A password or PIN field has focus
- A payment form is open
- Any screen your privacy policy says is not recorded
Prerequisites¶
- The SDK is installed and initialized. See the Quick Start.
Usage¶
Pause and resume¶
import { DeaSdk } from '@dea/sdk';
DeaSdk.current?.pause();
// … sensitive input …
DeaSdk.current?.resume();
Always pair pause() with resume(). Time spent paused adds no
actions, so a session left paused never becomes
sufficient and its classification stays
'insufficient'. pause() and resume() are not a consent mechanism: to hold capture back until
the user agrees, see User Consent.
Note: Without any call from you, the SDK records nothing from a keystroke inside an
<input type="password">— not even its timing — and from any other keystroke only the kind of key, never the character. Pointer input on a password field, and the kind and timing of keystrokes in any other field, such as a card number or a one-time code, are recorded unless you pause.Note:
pause()andresume()do not nest. Oneresume()restarts capture however many timespause()was called, so two parts of your app that pause on their own interfere: the first one to resume restarts capture while the other still shows sensitive content. Give pausing one owner, or count the pauses yourself and callresume()only when the count is back to zero.
Examples¶
Pause while a password field has focus¶
import { DeaSdk } from '@dea/sdk';
for (const field of document.querySelectorAll<HTMLInputElement>('input[type="password"]')) {
field.addEventListener('focus', () => DeaSdk.current?.pause());
field.addEventListener('blur', () => DeaSdk.current?.resume());
}
React: pause for as long as a component is mounted¶
import { useEffect } from 'react';
import { DeaSdk } from '@dea/sdk';
export function PaymentForm() {
useEffect(() => {
DeaSdk.current?.pause();
return () => DeaSdk.current?.resume();
}, []);
return <form>{/* card fields */}</form>;
}
API¶
| Member | Returns | Description |
|---|---|---|
pause() |
void |
Stops recording. The session is kept |
resume() |
void |
Starts recording again |