redact
Call Signature
Section titled “Call Signature”redact(
locator,options?):Promise<RedactHandle>
Defined in: redact.ts:166
Mask the element(s) matched by locator so the content never enters the
recording. The mask is applied client side in the live DOM, so the obscured
pixels are never captured and never uploaded to screenci. This is true
redaction, unlike cover, which only hides content in the published
output.
To hide a secret that is already on screen without a visible flash, register
the mask before revealing it (inside hide() or via the recordOptions.redact
config for always-secret elements).
Parameters
Section titled “Parameters”locator
Section titled “locator”Locator
options?
Section titled “options?”Returns
Section titled “Returns”Promise<RedactHandle>
Examples
Section titled “Examples”const handle = await redact(page.getByTestId('api-key'))// ... laterawait handle.unredact()await redact(page.getByTestId('balance'), async () => { await page.getByRole('button', { name: 'Reveal' }).click()})Call Signature
Section titled “Call Signature”redact(
locator,fn,options?):Promise<void>
Defined in: redact.ts:170
Mask the element(s) matched by locator so the content never enters the
recording. The mask is applied client side in the live DOM, so the obscured
pixels are never captured and never uploaded to screenci. This is true
redaction, unlike cover, which only hides content in the published
output.
To hide a secret that is already on screen without a visible flash, register
the mask before revealing it (inside hide() or via the recordOptions.redact
config for always-secret elements).
Parameters
Section titled “Parameters”locator
Section titled “locator”Locator
() => void | Promise<void>
options?
Section titled “options?”Returns
Section titled “Returns”Promise<void>
Examples
Section titled “Examples”const handle = await redact(page.getByTestId('api-key'))// ... laterawait handle.unredact()await redact(page.getByTestId('balance'), async () => { await page.getByRole('button', { name: 'Reveal' }).click()})