Storage

View as MarkdownOpen in Claude

Key-value storage interface for persisting SDK preferences and state.

Methods

clear()

1clear(scope): Promise<void>

Clears all keys in the given scope. Implementations may scope the clear to SDK keys only.

Parameters

scope
StorageScopeRequired

Storage scope (e.g. session vs. persistent).

Returns

Promise<void>


getItem()

1getItem(key, scope): Promise<string | null>

Parameters

key
stringRequired

Storage key to read or write.

scope
StorageScopeRequired

Storage scope (e.g. session vs. persistent).

Returns

Promise<string | null>


removeItem()

1removeItem(key, scope): Promise<void>

Parameters

key
stringRequired

Storage key to read or write.

scope
StorageScopeRequired

Storage scope (e.g. session vs. persistent).

Returns

Promise<void>


setItem()

1setItem(key, value, scope): Promise<void>

Parameters

key
stringRequired

Storage key to read or write.

value
string | nullRequired

Value to write, or null to clear the key.

scope
StorageScopeRequired

Storage scope (e.g. session vs. persistent).

Returns

Promise<void>