navigation
Close the current view, open external URLs, share content, and control device-level display settings like orientation, secure screen, and screen-awake mode. This namespace covers the host-environment integration points that shape how a mini-app fits into the surrounding Toss app.
Methods
| Method | Purpose |
|---|---|
closeView | Close the current mini-app view. |
getTossShareLink | Generate a Toss in-app share link. |
openURL | Open an external URL. |
requestReview | Trigger an App Store / Play Store review prompt. |
setDeviceOrientation | Lock the screen to portrait or landscape. |
setIosSwipeGestureEnabled | Enable or disable the iOS edge-swipe back gesture. |
setScreenAwakeMode | Prevent the screen from auto-dimming. |
setSecureScreen | Block screen capture and recording. |
share | Open the system share sheet with a message. |
Permission
No permission required. None of the methods in this namespace are bound to a PermissionName, and none expose getPermission() / openPermissionDialog() helpers. For the permission flow used by other namespaces, see Guides — Permissions pattern.
UX guidance
- Use
closeViewonly for deliberate exits. Call it from a "Done" button or an "×" icon — explicit signals that the user wants to leave. Calling it from an error handler makes the view disappear unexpectedly. - Always release
setScreenAwakeMode. Screen-awake mode drains the battery fast. When the feature that needs the screen on is done (or the component unmounts), callsetScreenAwakeMode({ enabled: false }). AuseEffectcleanup is the right place. - Don't over-apply
setSecureScreen. Reserve it for screens that genuinely contain sensitive data — payment details, identity numbers. Blocking every screen makes sharing impossible and can clash with accessibility tools. - Use
setDeviceOrientationfor real layout needs. Only lock orientation when the feature meaningfully requires it (video playback, a game, a map in landscape). Arbitrary locks create friction.
Try it live
All methods are available on the Navigation page in sdk-example.
Open in sdk-exampleExternal references
@apps-in-toss/web-framework— SDK package. The actual exports are re-exported from@apps-in-toss/web-bridge.- Web standard counterpart:
navigator.share— the@ait-co/polyfillpackage provides a shim that routessharethroughnavigator.share.