Share Methodsclipboard.write

clipboard.write

Copies text to the clipboard.

Writes text to the phone's clipboard.

PropertyValue
ScopeNone (open method)
Who can use itAny developer
StatusAvailable

Parameters

NameTypeRequiredDescription
textstringYesUp to 16,384 characters.

Result

FieldTypeDescription
okbooleantrue when the text was copied.

Errors

CodeWhen
-32602A parameter is missing, has the wrong type or is over its limit.
4200The phone could not do it right now.
4290More than 30 requests in 10 seconds.

See Error Codes for every code and how they reach your page.

Example

js
await window.aksa.request({ method: "clipboard.write", params: { text: shareLink } });
toast("Copied");

With AksaMini

If your page embeds aksa-mini.js, use its wrapper:

js
const copied = await AksaMini.copy(shareLink);

Notes

  • There is no clipboard read method. Your app can put text on the clipboard but cannot see what is on it.

Used By

Ready To Build Or Ship?

Check your files, preview on an iPhone frame, and submit in the Developer Studio.