Skip to content

StorageAdapter

Defined in: packages/api-client/src/core/storage/StorageAdapter.ts:10

Async key/value storage abstraction. Consumers wire the concrete impl at client construction time so the SDK stays platform-agnostic.

Methods are async even when a particular runtime offers a synchronous equivalent (e.g. localStorage). React Native’s AsyncStorage is intrinsically async; mirroring that contract avoids leaking platform differences into the SDK surface.

getItem(key): Promise<string | null>

Defined in: packages/api-client/src/core/storage/StorageAdapter.ts:12

Returns the stored value, or null when no entry exists.

string

Promise<string | null>


removeItem(key): Promise<void>

Defined in: packages/api-client/src/core/storage/StorageAdapter.ts:16

Removes the entry at key. Idempotent — no-op when absent.

string

Promise<void>


setItem(key, value): Promise<void>

Defined in: packages/api-client/src/core/storage/StorageAdapter.ts:14

Persists the value, overwriting any existing entry under key.

string

string

Promise<void>