> For the complete documentation index, see [llms.txt](https://wiki.playgama.com/playgama/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.playgama.com/playgama/bridge-sdk/api/clipboard.md).

# Clipboard

{% hint style="info" %}
You are reading the documentation for Bridge SDK **v2**. If you need the obsolete v1 documentation, see [Documentation (v1)](https://wiki.playgama.com/playgama/bridge-sdk-v1).
{% endhint %}

Read and write the system clipboard — useful for "copy invite link" or "paste promo code" flows.

{% hint style="info" %}
The clipboard module is exposed in the Plain JS SDK and Cocos Creator only. The engine plugins (Unity, Construct 3, GDevelop, Godot, GameMaker, Defold, Scratch) do not wrap it — call the JS API directly from your engine's JS interop if you need it there.
{% endhint %}

## Support

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.clipboard.isSupported
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.clipboard.isSupported
```

{% endtab %}
{% endtabs %}

## Write

Copies a string to the clipboard.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.clipboard.write('https://my.game/invite/abc123')
    .then(() => {
        // copied
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.clipboard.write('https://my.game/invite/abc123')
    .then(() => {
        // copied
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}

## Read

Reads the current clipboard text. Browsers may ask the player for permission — call it only from a direct player action.

{% tabs %}
{% tab title="Plain JS" %}

```javascript
bridge.clipboard.read()
    .then(text => {
        console.log('Clipboard: ', text)
    })
    .catch(error => {
        // error
    })
```

{% endtab %}

{% tab title="Cocos Creator" %}

```javascript
bridge.clipboard.read()
    .then(text => {
        console.log('Clipboard: ', text)
    })
    .catch(error => {
        // error
    })
```

{% endtab %}
{% endtabs %}
