This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 57).
Expo Clipboard
A universal library that allows getting and setting Clipboard content.
expo-clipboard provides an interface for getting and setting Clipboard content on Android, iOS, and Web.
Installation
If you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Mark clipboard content as sensitive (Android)
When you copy sensitive data such as passwords, one-time passwords (OTPs), access tokens, payment details, or personally identifiable information (PII), set android.isSensitive in setStringAsync and setImageAsync.
Setting android.isSensitive: true marks clipboard content as sensitive, based on Android guidance for secure clipboard handling. This can help:
- Obfuscate clipboard previews shown by keyboards
- Hide clipboard preview overlays on Android 13 and later
- Reduce accidental exposure from shoulder surfing
import * as Clipboard from 'expo-clipboard'; // Sensitive text await Clipboard.setStringAsync('my-secret-token', { android: { isSensitive: true }, }); // Sensitive image await Clipboard.setImageAsync(base64Image, { android: { isSensitive: true }, });
API
import * as Clipboard from 'expo-clipboard';
On Web, this module uses the
AsyncClipboardAPI, which might behave differently between browsers or not be fully supported. Especially on WebKit, there's an issue which makes this API unusable in asynchronous code. Click here for more details.
No API data file found, sorry!