> For the complete documentation index, see [llms.txt](https://help.twinr.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.twinr.dev/js-bridge/copy-to-clipboard.md).

# Copy to Clipboard

**JavaScript Function**

```
twinr_clipboard_set()
```

This function allows your webview or web app to copy custom text to the device's clipboard, which the user can then paste anywhere on their device.

***

#### Usage

```javascript
twinr_clipboard_set("Text to be copied");
```

Example

```javascript
twinr_clipboard_set("https://twinr.dev/invite-code");
```

In this example, the invite URL will be copied to the user’s clipboard when the function is called. You can trigger this function on a button click, form submission, or any custom logic.

#### Use Cases

* Copy **promo codes**, **invite links**, or **referral IDs**
* Simplify **text sharing**
* Allow users to quickly **copy support contact info**, FAQs, etc.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.twinr.dev/js-bridge/copy-to-clipboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
