---
name: "getSetting"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "3.12.0" }
platform:
  - "iOS"
  - "Android"
async: true
title: "getSetting - Get user's current settings. Return value only contains permissions that the mini app has requested from the user"
---

## getSetting

> [VERSION] BaseKit >= 3.12.0

> [PLATFORM] iOS, Android

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

### Description

Get the user's current settings. The return value only includes permissions the miniapp has requested

### Parameters

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

#### success callback parameters

| Property | Type | Since | Description |
| --- | --- | --- | --- |
| `authSetting` | `Record<string, boolean>` | `3.12.0` | User authorization result |

#### 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` | Extended error code |
| `errorMsg` | `string` | Extended error information |


### Examples

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