One meaning on both platforms
An option means the same on iOS and Android. A platform that can’t do it throws, so shared code never needs a Platform.select to stay safe.
The iOS Keychain and the Android Keystore behind one API. Every option means the same on both platforms, and protection is never lowered in silence.
An option means the same on iOS and Android. A platform that can’t do it throws, so shared code never needs a Platform.select to stay safe.
If the device can’t give the protection you asked for, the write fails. A value is never stored with less than you asked.
Face ID or a fingerprint unlocks the key that decrypts the item, inside the Secure Enclave or the TEE. There is no boolean to fake.
Storing a value never shows a prompt on either platform. Only reading a protected item does, and the OS draws it.
A missing value is null. A changed fingerprint set is KEY_INVALIDATED, not null. Every failure has a code.
The module does no work when it loads: a service is read the first time you use it, and reads without a prompt never wait for one.
A TurboModule with a typed codegen spec, for React Native 0.80 and newer: bare apps and Expo dev builds alike.
Keychain items on iOS, Keystore-encrypted files on Android. Your code sees one key/value store per service.
import { AccessControl, createKeychain, keychain } from '@apexnative/keychain'; await keychain.setItem('accessToken', token); const vault = createKeychain({ service: 'vault', accessControl: AccessControl.BiometryCurrentSet, prompt: { title: 'Unlock your account' }, }); await vault.setItem('refreshToken', refresh); // no prompt const value = await vault.getItem('refreshToken'); // Face ID