# AsyncStorageKeyValue

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:8](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L8)

React Native AsyncStorage implementation of IKeyValueStorage. Provides a key-value storage backend using React Native's AsyncStorage.

## Implements

* [`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md)<`true`>

## Constructors

### Constructor

```
new AsyncStorageKeyValue(prefix): AsyncStorageKeyValue;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:18](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L18)

Creates a new AsyncStorageKeyValue instance

#### Parameters

| Parameter | Type     | Description                                                  |
| --------- | -------- | ------------------------------------------------------------ |
| `prefix`  | `string` | Prefix added to all keys to avoid collisions with other data |

#### Returns

`AsyncStorageKeyValue`

## Properties

### async

```
async: true = true;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:9](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L9)

Whether this storage backend is asynchronous

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`async`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#async-1)

***

### prefix

```
prefix: string;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:12](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L12)

Key prefix used to namespace storage entries

## Methods

### get()

```
get(key): Promise<string>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:37](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L37)

Retrieves a value by key

#### Parameters

| Parameter | Type     | Description        |
| --------- | -------- | ------------------ |
| `key`     | `string` | The key to look up |

#### Returns

`Promise`<`string`>

The stored value, or null if not found

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`get`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#get)

***

### getAll()

```
getAll(keys): Promise<string[]>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:42](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L42)

Retrieves multiple values by keys (optional batch operation)

#### Parameters

| Parameter | Type        | Description              |
| --------- | ----------- | ------------------------ |
| `keys`    | `string`\[] | Array of keys to look up |

#### Returns

`Promise`<`string`\[]>

Array of values in the same order as keys, null for missing keys

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`getAll`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#getall)

***

### getKeys()

```
getKeys(): Promise<string[]>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:28](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L28)

Returns all keys in the storage

#### Returns

`Promise`<`string`\[]>

Array of all stored keys

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`getKeys`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#getkeys)

***

### init()

```
init(): Promise<void>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:23](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L23)

Initializes the storage backend

#### Returns

`Promise`<`void`>

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`init`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#init)

***

### remove()

```
remove(key): Promise<void>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:49](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L49)

Removes a value by key

#### Parameters

| Parameter | Type     | Description       |
| --------- | -------- | ----------------- |
| `key`     | `string` | The key to remove |

#### Returns

`Promise`<`void`>

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`remove`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#remove)

***

### removeAll()

```
removeAll(keys): Promise<void>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:54](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L54)

Removes multiple values by keys (optional batch operation)

#### Parameters

| Parameter | Type        | Description             |
| --------- | ----------- | ----------------------- |
| `keys`    | `string`\[] | Array of keys to remove |

#### Returns

`Promise`<`void`>

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`removeAll`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#removeall)

***

### set()

```
set(key, value): Promise<void>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:59](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L59)

Stores a value at the given key

#### Parameters

| Parameter | Type     | Description               |
| --------- | -------- | ------------------------- |
| `key`     | `string` | The key to store under    |
| `value`   | `string` | The string value to store |

#### Returns

`Promise`<`void`>

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`set`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#set)

***

### setAll()

```
setAll(values): Promise<void>;
```

Defined in: [atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:64](https://github.com/atomiqlabs/atomiq-storage-rn-async/blob/d72db35bdcf39750e50ed13a90edb5c50b764a5b/src/AsyncStorageKeyValue.ts#L64)

Stores multiple key-value pairs (optional batch operation)

#### Parameters

| Parameter | Type        | Description                       |
| --------- | ----------- | --------------------------------- |
| `values`  | `object`\[] | Array of key-value pairs to store |

#### Returns

`Promise`<`void`>

#### Implementation of

[`IKeyValueStorage`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md).[`setAll`](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/interfaces/IKeyValueStorage.md#setall)
