Clipboard
Copy text to the player's clipboard through the see_lib NUI — one call, always available.
Copy text to the player's clipboard through the see_lib NUI — one call, always available.
lib.copyToClipboard(text) copies text to the player's clipboard through the see_lib NUI (a hidden
textarea + execCommand('copy')). It's available as soon as see_lib starts — no lib.require needed.
RegisterCommand('copyid', function()
local identifier = lib.bridge.getPlayer(GetPlayerServerId(PlayerId())).identifier
lib.copyToClipboard(identifier)
end, false)textstringrequiredThe text to copy.
It's exposed as lib.copyToClipboard, not lib.clipboard — it isn't a lazy-loaded module, it's
always there once see_lib is running. It relies on the see_lib NUI frame: if that frame isn't loaded
(resource stopped, web build missing), the call is a silent no-op — no error, nothing copied. There's
no success callback either, so Lua can't tell whether the copy actually worked. Don't copy secrets or
tokens without user confirmation — the system clipboard isn't masked.