Skip to main content

setSecureScreen

Blocks or allows screen capture (screenshots) and screen recording. Use this for screens that contain sensitive data — payment details, personal identification numbers, authentication codes.

Signature

import { setSecureScreen } from '@apps-in-toss/web-framework';

declare function setSecureScreen(options: {
enabled: boolean;
}): Promise<{ enabled: boolean }>;

Parameters

NameTypeRequiredDescription
options.enabledbooleantrue to block capture and recording; false to restore normal behavior.

Returns

  • Promise<{ enabled: boolean }> — resolves with the current enabled state after the setting is applied.

Permission

No permission required.

Examples

Minimal

import { setSecureScreen } from '@apps-in-toss/web-framework';

await setSecureScreen({ enabled: true });

Realistic — protecting a payment details screen

import { setSecureScreen } from '@apps-in-toss/web-framework';
import { useEffect } from 'react';

export function PaymentDetailsScreen() {
useEffect(() => {
// Block capture while sensitive payment data is visible.
setSecureScreen({ enabled: true });

return () => {
// Lift the restriction when the screen unmounts.
setSecureScreen({ enabled: false });
};
}, []);

return <div>{/* Card number, account details, etc. */}</div>;
}

Try it live

Open the Navigation page in sdk-example and run the setSecureScreen card.

Open in sdk-example

External references