Skip to main content

getStorageItem

Description

Get the value of data saved in local storage based on key and appId attributes

Parameters

ParamData typeRequiredDescription
appIdnumberYesID of the mini app, registered via Merchant Portal
keystringYesKey is used to get the data value stored in storage

Return Value

ParamData typeDescription
valuestringData value corresponding to key attribute

Error Code

N/A

Sample Code and Sample Return Data

Sample Request:

window.zlpSdk.Storage
.getStorageItem({ appId: -9999, key: 'datacodeId' })
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));

Sample Response:

{ 
data: {
value: "DC10"
},
status: "success"
}