React Native Async Storage
Async Storage is an asynchronous, unencrypted, persistent key-value storage solution for your React Native application.
It provides a simple API compatible with
the Web Storage API, with additional extensions for
batch operations and multi-database support.
Supported platforms
- Android (SQLite)
- iOS (SQLite)
- macOS (SQLite)
- visionOS (legacy fallback, single database only)
- Web (IndexedDB backend)
- Windows (legacy fallback, single database only)
Compatibility
Compatibility table for React Native:
| React Native | Minimum Version |
|---|
| ios/android | 0.76 |
| macOS | 0.78 |
| visionOS |
Other components:
| Component | Version |
|---|
| kotlin | 2.1.0 |
| android min sdk | 24 |
| ios min target |
Installation
# Using npm
npm install @react-native-async-storage/async-storage
# Using yarn
yarn add @react-native-async-storage/async-storage
iOS/macOS
Install cocoapods dependencies:
# inside macos/ios directory
pod install
Usage
{ createAsyncStorage } ;
storage = ();
() {
storage.(, );
token = storage.();
.(, token);
storage.();
}
License
MIT