my.getAppIdSync

Use this API to obtain the Mini Program App ID synchronously.

Sample Code

copy
const appIdRes = my.getAppIdSync();
console.log(appIdRes.appId);

Return Value

PropertyTypeDescription
appIdStringThe App ID of the current Mini Program.Â