For the complete documentation index, see llms.txt. This page is also available as Markdown.

Clipboard

You are reading the documentation for Bridge SDK v2. If you need the obsolete v1 documentation, see Documentation (v1).

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

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.

Support

bridge.clipboard.isSupported
bridge.clipboard.isSupported

Write

Copies a string to the clipboard.

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

Read

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

Last updated