# Object wx.getAccountInfoSync()

Start from base library version 2.2.2. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Support, need to Mini Program base library version no less than 2.2.2

Gets the current account information. Online Mini Program version number is only available in the official version of the Mini Program, development version and experience version can not be obtained.

# Return value

# Object

Account information

attribute type Introductions
miniProgram Object Mini Program account information
plugin Object Plug-in account information (include this only when called in a plug-in)

miniProgram Structure

attribute type Introductions Minimum version
appId string Mini Program appId
EnvVersion string Mini Program version 2.10.0
version string Online Mini Program version number 2.10.2

miniProgram.envVersion Legal value

value Introductions Minimum version
develop Development version
trial Experience version
release Official version

plugin Structure

attribute type Introductions
appId string plug-in appId
version string Plug-in version number

# sample code

const accountInfo = wx.getAccountInfoSync()
console.log(accountInfo.miniProgram.appId) // Mini Program appId
console.log(accountInfo.plugin.appId) // plug-in appId
console.log(accountInfo.plugin.version) // Plug-in version number, 'a.b.c' This form