Skip to main content

clipboard

Namespace for reading and writing the system clipboard. Covers everyday mobile UX like sharing invite codes, pasting coupons, and "Copy link" buttons.

Unofficial docs

This page is community-written. The SDK behavior itself is defined by the upstream @apps-in-toss/web-framework release.

Methods

MethodPurpose
getClipboardTextRead text from the clipboard.
setClipboardTextCopy text to the clipboard.

Permission

The whole namespace shares a single clipboard permission. Both methods are bound to the same PermissionName, so granting access through one immediately enables the other. setClipboardText.getPermission() and getClipboardText.getPermission() always return the same value — check whichever is more convenient.

  • Calling either method while the status is denied throws. Check with getPermission() first.
  • If the user hasn't decided yet, trigger the system dialog with openPermissionDialog().

Both methods expose getPermission() / openPermissionDialog() helpers on the function object — see each page's "Permission" section.

UX guidance

  • Write in response to an explicit user action (a "Copy" button) and confirm with a toast.
  • Read only in response to an explicit "Paste" gesture. Automatic clipboard reads on screen load feel intrusive and are the kind of behavior the OS is likely to restrict further.
  • Always validate the string you read. Don't assume it matches your format — run a regex, check URL allowlists, trim whitespace.

Try it live

Both methods are available on the Clipboard page in sdk-example.

Open in sdk-example

External references