Skip to main content

getStorageInfo

Description

Get information about the memory storage of a miniapp

Parameters

ParamData typeRequiredDescription
appIdnumberYesID of the mini app, registered via Merchant Portal

Return Value

ParamData typeDescription
quotanumberThe memory capacity that the miniapp is allocated
usednumberThe memory capacity that the miniapp has used
remainingnumberThe free memory capacity

Error Code

N/A

Sample Code and Sample Return Data

Sample Request:

window.zlpSdk.Storage
.getStorageInfo({ appId: -9999 })
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));

Sample Response:

{
data: {
quota: 4096,
used: 2048,
remaining: 2048
},
status: "success"
}