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
| Name | Type | Required | Description |
|---|---|---|---|
options.enabled | boolean | ✓ | true to block capture and recording; false to restore normal behavior. |
Returns
Promise<{ enabled: boolean }>— resolves with the currentenabledstate 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.
Related APIs
setScreenAwakeMode— prevent the screen from auto-dimming.setDeviceOrientation— lock the screen orientation.
Related guides
- Guides — Mini-app navigation flow patterns — mini-app entry/exit, opening external URLs, and screen-context (orientation, awake, secure) patterns.
External references
@apps-in-toss/web-framework— SDK package. The actual exports are re-exported from@apps-in-toss/web-bridge.