react-native-keychain — secure credential storage.
1import * as Keychain from "react-native-keychain";23// Save credentials4await Keychain.setGenericPassword("username", "password");56// Retrieve credentials7const credentials = await Keychain.getGenericPassword();8if (credentials) {9 console.log(`User: ${credentials.username}`);10}1112// Delete credentials13await Keychain.resetGenericPassword();
Storage options:
Keychain ACCESSIBLE.WHEN_UNLOCKEDKeychain.ACCESSIBLE.WHEN_PASSCODE_SETKeychain.ACCESSIBLE.ALWAYS_THIS_DEVICE_ONLYBest practices: