Skip to main content
Use this API to get data stored with a specified key from local cache.

Parameters

PropertyTypeRequiredDescription
keyStringYesStorage key identifier
successFunctionNoCallback with data
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Success Callback

PropertyTypeDescription
dataObject/StringStored data

Code Example

my.getStorage({
  key: 'userSettings',
  success: (res) => {
    console.log('Data:', res.data);
  },
  fail: () => {
    console.log('Key not found');
  }
});

my.setStorage

Store data

my.getStorageSync

Get data synchronously