Skip to content

MemoryStorageAdapter

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

In-memory StorageAdapter backed by a Map<string, string>.

Useful as the default for server-side runtimes (Next.js SSR, Node CLIs) where there is no persistent client-side storage, and as a sensible fallback for React Native consumers who have not yet wired AsyncStorage.

State lives for the lifetime of the instance; new instances start empty.

new MemoryStorageAdapter(): MemoryStorageAdapter

MemoryStorageAdapter

getItem(key): Promise<string | null>

Defined in: packages/api-client/src/core/storage/MemoryStorageAdapter.ts:15

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

string

Promise<string | null>

StorageAdapter.getItem


removeItem(key): Promise<void>

Defined in: packages/api-client/src/core/storage/MemoryStorageAdapter.ts:24

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

string

Promise<void>

StorageAdapter.removeItem


setItem(key, value): Promise<void>

Defined in: packages/api-client/src/core/storage/MemoryStorageAdapter.ts:20

Persists the value, overwriting any existing entry under key.

string

string

Promise<void>

StorageAdapter.setItem