The video uses a specific AI coding tool to demonstrate the setup, but the configuration works 1:1 with Cursor, Claude Code, or any other tool. Despia is web framework and tooling agnostic, so the only thing that matters is the SDK call and reading
.clipboarddata from the result.getclipboard:// returns the current text contents of the device clipboard. The runtime uses the native Pasteboard API on iOS and the Clipboard Service on Android, so the read goes through the same path as a manual paste, and triggers the same OS-level transparency banner (“MyApp pasted from Notes”) on iOS 14 and later.
iOS shows a small banner at the top of the screen the first time your app reads from the clipboard in a session. This is a system behavior, not configurable from Despia. Only call
getclipboard:// in response to a clear user action like a “Paste” button tap, never on app launch or in the background, otherwise the banner will appear unexpectedly and look invasive.Installation
- Bundle
- CDN
How it works
getclipboard:// is async. Await the call and read the text from the clipboarddata key on the returned object.
Paste from a button
The natural pattern is a “Paste” button next to an input. Tap it, the clipboard content fills the field, the user reviews and submits..trim() is worth doing reflexively. People copy text with leading or trailing whitespace constantly (especially from email signatures, code blocks, and chat apps), and most validation regexes do not account for it.
Detect and validate before pasting
For codes with a known shape (referral codes, coupons, OAuth one-time tokens) you can sniff the clipboard on app focus and offer a one-tap paste banner if the contents look right. This is gentler than always reading on launch, since the banner only appears when the clipboard probably contains something the user wanted to paste.Browser fallback
In a regular browser the SDK call is a no-op behind theisDespia guard. Fall back to the standard Clipboard API for web users.
Resources
NPM Package
despia-native