---
name: "getAccountInfo"
mode: "kit"
versionRequirements:
  - { name: "MiniKit", version: "3.1.0" }
platform:
  - "iOS"
  - "Android"
async: true
---

## getAccountInfo

> [VERSION] MiniKit >= 3.1.0

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Get Mini Program account information

### Parameters

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `complete` | `() => void` | No | - | Callback invoked when the API call completes (runs on success or failure) |
| `success` | `(params: Object) => void` ↓see below | No | - | Callback for API call success |
| `fail` | `(params: Object) => void` ↓see below | No | - | Callback for API call failure |

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `miniProgram` | `MiniProgramAccountInfo` | `3.2.0` | Mini Program account information |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension information |


### Referenced Types

##### `interface` MiniProgramAccountInfo

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `appId` | `string` | `3.2.0` | Mini Program appId |
| `envVersion` | `string` | `3.2.0` | Mini Program version develop: development version trail: trial version release: release version |
| `version` | `string` | `3.2.0` | Mini Program version number |
| `appName` | `string` | `3.12.1` | Miniapp name |
| `appIcon` | `string` | `3.12.1` | Miniapp icon |
| `providerType` | `string` | `3.23.0` | Miniapp provider type third: Third-party official: Official |


### Examples

```tsx
ty.getAccountInfo({
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
