Skip to main content
Synchronous version of my.getStorage.

Parameters

PropertyTypeRequiredDescription
keyStringYesStorage key identifier

Return Value

Returns the stored data or undefined if key doesn’t exist.

Code Example

const data = my.getStorageSync({ key: 'token' });
if (data) {
  console.log('Token:', data.data);
}

my.getStorage

Get data asynchronously

my.setStorageSync

Store data synchronously