Skip to content

Scripting API / core/StorageApi

core/StorageApi

Classes

StorageApi

Stores data which persists across a single session. When a user is logged out, this data is removed.

Methods

clear()

clear(): Promise<void>

Removes all values from the persistent storage.

Returns

Promise<void>

getItem()

getItem(key): Promise<any>

Retrieves an object from the persistent storage. Returns undefined if the object is not present

Parameters
Parameter Type Description
key string The key used to store the value
Returns

Promise<any>

removeItem()

removeItem(key): Promise<void>

Removes a value from the persistent storage. If no value was stored, this function will have no effect.

Parameters
Parameter Type Description
key string The key used to store the value
Returns

Promise<void>

setItem()

setItem(key, value): Promise<void>

Stores a value in the persistent storage.

Parameters
Parameter Type Description
key string The key to store the value under
value any The value to store
Returns

Promise<void>