Skip to content

Commit 37480d8

Browse files
committed
docs: info about min version
1 parent 33e24b7 commit 37480d8

File tree

4 files changed

+65
-43
lines changed

4 files changed

+65
-43
lines changed

README.md

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# React Native Async Storage
22

3-
Async Storage is asynchronous, unencrypted, persistent, key-value storage for your React Native application.
4-
It provides a simple API compatible with the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API), with a few extensions for batch operations and multi-database support.
3+
Async Storage is an asynchronous, unencrypted, persistent key-value storage solution for your React Native application.
4+
It provides a simple API compatible with the [Web Storage API]((https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API)), with additional extensions for batch operations and multi-database support.
55

6-
---
76

87
## Supported platforms
98

@@ -13,19 +12,49 @@ It provides a simple API compatible with the [Web Storage API](https://developer
1312
- **macOS** (SQLite backend via Room KMP)
1413
- **Windows** (legacy fallback, single database only)
1514

15+
16+
## Supported versions
17+
18+
| Component | Minimum Version |
19+
|-----------------|-----------------|
20+
| React Native | 0.76 |
21+
| Kotlin | 2.1.0 |
22+
| KSP | 2.1.0-1.0.28 |
23+
| Android min sdk | 24 |
24+
25+
1626
---
1727

1828
## Installation
1929

2030
```shell
21-
# using npm
31+
# Using npm
2232
npm install @react-native-async-storage/async-storage
2333

24-
# using yarn
34+
# Using yarn
2535
yarn add @react-native-async-storage/async-storage
2636
```
2737

28-
On iOS/macOS, don’t forget to install pods:
38+
### Android
39+
40+
Inside your `android/build.gradle(.kts)` file, add link to local maven repo:
41+
42+
```groovy
43+
allprojects {
44+
repositories {
45+
// ... others like google(), mavenCentral()
46+
47+
maven {
48+
// or uri("path/to/node_modules/@react-native-async-storage/async-storage/android/local_repo")
49+
url = uri(project(":react-native-async-storage_async-storage").file("local_repo"))
50+
}
51+
}
52+
}
53+
```
54+
55+
### iOS/macOS
56+
57+
Install cocoapods dependencies:
2958

3059
```shell
3160
# inside macos/ios directory
@@ -34,12 +63,10 @@ pod install
3463

3564
## Usage
3665

37-
### Basic
38-
3966
```typescript
4067
import { createAsyncStorage } from "@react-native-async-storage/async-storage";
4168

42-
// Create a storage instance
69+
// create a storage instance
4370
const storage = createAsyncStorage("appDB");
4471

4572
async function demo() {
@@ -48,41 +75,16 @@ async function demo() {
4875

4976
// read value stored at "userToken" key
5077
const token = await storage.getItem("userToken");
51-
console.log("Stored token:", token);
78+
console.log("Stored token:", token); // abc123
5279

5380
// remove value from storage
5481
await storage.removeItem("userToken");
5582
}
5683
```
5784

58-
### Multi-item operations
59-
60-
Async Storage supports batch operations for efficiency:
61-
62-
```typescript
63-
async function demo() {
64-
// save multiple values at once
65-
await storage.setMany({
66-
theme: "dark",
67-
language: "en",
68-
});
69-
70-
// Retrieve multiple values
71-
const values = await storage.getMany(["theme", "language", "different"]);
72-
console.log(values); // { theme: "dark", language: "en", different: null }
73-
74-
// Remove multiple values
75-
await storage.removeMany(["theme", "language"]);
76-
}
77-
```
78-
79-
## Contribution
80-
81-
Pull requests are welcome. Please open an issue first to discuss what you would
82-
like to change.
85+
Head over to [Usage page](api/usage.md) to learn more.
8386

84-
See the [CONTRIBUTING](.github/CONTRIBUTING.md) file for more information.
8587

8688
## License
8789

88-
MIT
90+
MIT

docs/index.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,30 @@
22
title: Overview
33
---
44

5-
# Async Storage
5+
# React Native Async Storage
66

77
Async Storage is an asynchronous, unencrypted, persistent key-value storage solution for your React Native application.
88
It provides a simple API compatible with the [Web Storage API]((https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API)), with additional extensions for batch operations and multi-database support.
99

10-
---
1110

12-
## Supported Platforms
11+
## Supported platforms
1312

1413
- **Android** (SQLite backend via Room KMP)
1514
- **iOS** (SQLite backend via Room KMP)
1615
- **Web** (IndexedDB backend)
1716
- **macOS** (SQLite backend via Room KMP)
18-
- **Windows** (legacy fallback, single-database only)
17+
- **Windows** (legacy fallback, single database only)
18+
19+
20+
## Supported versions
21+
22+
| Component | Minimum Version |
23+
|-----------------|-----------------|
24+
| React Native | 0.76 |
25+
| Kotlin | 2.1.0 |
26+
| KSP | 2.1.0-1.0.28 |
27+
| Android min sdk | 24 |
28+
1929

2030
---
2131

@@ -77,3 +87,8 @@ async function demo() {
7787
```
7888

7989
Head over to [Usage page](api/usage.md) to learn more.
90+
91+
92+
## License
93+
94+
MIT

packages/async-storage/android/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ apply plugin: "com.android.library"
2121
apply plugin: "kotlin-android"
2222
apply plugin: "com.facebook.react"
2323

24-
// to support migration from old storage
24+
// ksp/room is required to support legacy storage
2525
apply plugin: 'com.google.devtools.ksp'
2626

2727
def getExtOrDefault(name) {
@@ -94,6 +94,7 @@ dependencies {
9494
implementation "org.asyncstorage.shared_storage:storage-android:1.0.0"
9595

9696

97+
// ksp/room is required to support legacy storage
9798
def room_version = getExtOrDefault("ROOM_VERSION")
9899
implementation "androidx.room:room-runtime:$room_version"
99100
implementation "androidx.room:room-ktx:$room_version"

packages/async-storage/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@
3434
"!**/__tests__",
3535
"!**/__fixtures__",
3636
"!**/__mocks__",
37-
"!**/.*"
37+
"!**/.*",
38+
"!docs",
39+
"!examples",
40+
"!scripts",
41+
"!shared-storage"
3842
],
3943
"dependencies": {
4044
"idb": "8.0.3"

0 commit comments

Comments
 (0)