SensitiveClipboardService

Copies sensitive strings to the clipboard with verified automatic clearing. Mirrors password-manager behaviour: reads the clipboard before clearing and skips when the content no longer matches what was written, preventing clobbering of unrelated user copies.

TypeScriptexample.ts
import { SensitiveClipboardService } from '@angular-helpers/security'

# Methods

MethodSignatureReturnsDescription
isSupportedisSupported(): booleanbooleanPublic method isSupported.
copycopy(text: string, options: SensitiveCopyOptions): Promise<void>Promise<void>Writes `text` to the clipboard and schedules an auto-clear.
copy$copy$(text: string, options: SensitiveCopyOptions): Observable<CopyStatus>Observable<CopyStatus>Reactive variant of . Emits `'copied'` immediately after writing, then `'cleared'` | `'read-denied'` | `'error'` once the auto-clear completes (or is skipped).
cancelPendingClearcancelPendingClear(): voidvoidCancels any pending auto-clear timer. The clipboard content is not modified.
clearclear(): Promise<void>Promise<void>Forcefully clears the clipboard unconditionally.
LCP N/A
CLS N/A
INP N/A