{"id":49069,"library":"react-native-fast-secure-storage","title":"react-native-fast-secure-storage","description":"A fast, secure key-value storage library for React Native (iOS & Android) that provides encrypted data storage with a simple async API. Current version 1.2.3. Uses native iOS Keychain and Android EncryptedSharedPreferences for encryption. Differentiators: supports synchronous getItem/setItem operations, ACCESSIBLE levels, and batch operations (setItems, getAllItems, clearStorage). Alternatives: react-native-encrypted-storage (more limited), expo-secure-store (Expo-only). Types included. Peer dependencies: react and react-native.","status":"active","version":"1.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/IvanIhnatsiuk/react-native-fast-secure-storage","tags":["javascript","react-native","ios","android","typescript"],"install":[{"cmd":"npm install react-native-fast-secure-storage","lang":"bash","label":"npm"},{"cmd":"yarn add react-native-fast-secure-storage","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-native-fast-secure-storage","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - React Native requires React","package":"react","optional":false},{"reason":"peer dependency - native module initialization","package":"react-native","optional":false}],"imports":[{"note":"Default export is the storage object; no named import for the default.","wrong":"const SecureStorage = require('react-native-fast-secure-storage').default","symbol":"SecureStorage","correct":"import SecureStorage from 'react-native-fast-secure-storage'"},{"note":"Named export; used for optional 'accessible' parameter in setItem/setItems.","symbol":"ACCESSIBLE","correct":"import { ACCESSIBLE } from 'react-native-fast-secure-storage'"},{"note":"Sync methods available but should be avoided on main thread; same default import.","wrong":"import { SecureStorage } from 'react-native-fast-secure-storage'","symbol":"SecureStorage (sync methods)","correct":"import SecureStorage from 'react-native-fast-secure-storage'; SecureStorage.getItemSync('key')"}],"quickstart":{"code":"import SecureStorage, { ACCESSIBLE } from 'react-native-fast-secure-storage';\n\nasync function example() {\n  await SecureStorage.setItem('token', 'abc123', ACCESSIBLE.WHEN_UNLOCKED);\n  const token = await SecureStorage.getItem('token');\n  console.log(token); // 'abc123'\n\n  await SecureStorage.removeItem('token');\n\n  const hasToken = await SecureStorage.hasItem('token');\n  console.log(hasToken); // false\n}\n\nexample();","lang":"typescript","description":"Demonstrates basic setItem, getItem, removeItem, and hasItem usage with type safety."},"warnings":[{"fix":"Wrap in try/catch or use hasItem before calling getItem.","message":"getItem throws an error if the key does not exist or value is empty (not returning null).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use SecureStorage.deleteItem('key') instead.","message":"removeItem is not a method; use deleteItem instead. (Documentation shows removeItem but likely deprecation).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Check storage size or wrap in try/catch.","message":"getAllKeys and getAllItems throw an error if no items exist (cannot be called on empty storage).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Prefer async methods (getItem, setItem).","message":"Sync methods (getItemSync, setItemSync) run synchronously and can block the JS thread; use only for very fast operations or avoid.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.3':32 'access':47 'altern':55 'android':19,38,84 'api':29 'async':28 'batch':50 'clearstorag':54 'current':30 'data':23 'depend':73 'differenti':42 'encrypt':22,41,59 'encryptedsharedprefer':39 'expo':64,68 'expo-on':67 'expo-secure-stor':63 'fast':4,8 'getallitem':53 'getitem/setitem':45 'includ':71 'io':18,35,83 'javascript':79 'key':11 'key-valu':10 'keychain':36 'level':48 'librari':14 'limit':62 'nativ':3,17,34,58,78,82 'oper':46,51 'peer':72 'provid':21 'react':2,16,57,74,77,81 'react-nat':76,80 'react-native-encrypted-storag':56 'react-native-fast-secure-storag':1 'secur':5,9,65 'setitem':52 'simpl':27 'storag':6,13,24,60 'store':66 'support':43 'synchron':44 'type':70 'typescript':85 'use':33 'valu':12 'version':31","created_at":"2026-06-07T16:59:53.586020+00:00","updated_at":"2026-06-07T16:59:53.586020+00:00","problems":[{"fix":"import SecureStorage from 'react-native-fast-secure-storage';","cause":"Incorrect import: using named import instead of default.","error":"TypeError: SecureStorage.getItem is not a function"},{"fix":"Use hasItem to check existence before getItem, or wrap in try/catch.","cause":"getItem called on a key that is not stored or value is empty.","error":"Error: value does not exist"},{"fix":"Check if storage has any items before calling, or wrap in try/catch.","cause":"Calling getAllKeys or getAllItems when storage is empty.","error":"Error: Operation not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/IvanIhnatsiuk/react-native-fast-secure-storage#readme","github":"https://github.com/IvanIhnatsiuk/react-native-fast-secure-storage","docs":null,"changelog":null,"pypi":null,"npm":"react-native-fast-secure-storage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}