SmartStorageAbility.get(key: string, callback?: Function)

Requires:
@ray-js/panel-sdk≥1.0.0

Description

Read the stored data for the specified key

Parameters

ParameterTypeRequiredDescription
keystringYesStorage key
NoOptional callback invoked after the data is read

Return Value

Type: Promise<TReturnRes<T>>
Storage result containing timestamp and value

Examples

Example

const result = await sdm.storage.get<number>('brightness');
console.log('Value:', result.value, 'Time:', result.time);