clipboard.write
Copies text to the clipboard.
Writes text to the phone's clipboard.
| Property | Value |
|---|---|
| Scope | None (open method) |
| Who can use it | Any developer |
| Status | Available |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Up to 16,384 characters. |
Result
| Field | Type | Description |
|---|---|---|
ok | boolean | true when the text was copied. |
Errors
| Code | When |
|---|---|
-32602 | A parameter is missing, has the wrong type or is over its limit. |
4200 | The phone could not do it right now. |
4290 | More than 30 requests in 10 seconds. |
See Error Codes for every code and how they reach your page.
Example
await window.aksa.request({ method: "clipboard.write", params: { text: shareLink } });
toast("Copied");With AksaMini
If your page embeds aksa-mini.js, use its wrapper:
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.