> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.checkLocalBioAuthSupported

> Check if biometric authentication is available.

Use this API to check if biometric authentication (fingerprint or face recognition) is available on the device.

## Parameters

| Property | Type     | Required | Description                   |
| -------- | -------- | -------- | ----------------------------- |
| success  | Function | No       | Callback on success           |
| fail     | Function | No       | Callback on failure           |
| complete | Function | No       | Callback that always executes |

## Success Callback Parameters

| Property     | Type    | Description                                                                                                                      |
| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------- |
| success      | Boolean | Whether biometric authentication is available on the user's device. Returned by the `success` or `complete` callback.            |
| error        | Number  | The error code. Returned by the `fail` callback, or by the `complete` callback when `success` is `false`. See Error Codes below. |
| errorMessage | String  | The error message corresponding to the error code.                                                                               |

## Error Codes

| Code | Description                                                                                     |
| ---- | ----------------------------------------------------------------------------------------------- |
| 12   | Either the device lacks biometric support or the super app cannot access the biometric feature. |
| 13   | Biometric credentials are not enabled on the user's device.                                     |
| 99   | An undefined error has occurred. Please contact technical support for assistance.               |

## Code Example

### Basic Usage

```javascript theme={null}
my.checkLocalBioAuthSupported({
  success(res) {
    console.log('Biometric available:', res.success);
  },
  fail(res) {
    console.error('Error code:', res.error);
  }
});
```

### Conditional UI

```javascript theme={null}
Page({
  data: {
    biometricAvailable: false
  },

  onLoad() {
    my.checkLocalBioAuthSupported({
      success: (res) => {
        this.setData({
          biometricAvailable: res.success
        });
      }
    });
  }
});
```

### Smart Authentication

```javascript theme={null}
Page({
  authenticate() {
    my.checkLocalBioAuthSupported({
      success: (res) => {
        if (res.success) {
          this.useBiometric();
        } else {
          this.usePasswordAuth();
        }
      },
      fail: () => {
        this.usePasswordAuth();
      }
    });
  },

  useBiometric() {
    my.startLocalBioAuth({
      promptText: 'Verify your identity',
      success: (res) => {
        if (res.success) {
          this.onAuthSuccess();
        }
      },
      fail: () => {
        // Fall back to password
        this.usePasswordAuth();
      }
    });
  },

  usePasswordAuth() {
    // Show password input
  },

  onAuthSuccess() {
    // Proceed with authenticated action
  }
});
```

### Handling Errors

```javascript theme={null}
Page({
  data: {
    authMethods: []
  },

  onLoad() {
    my.checkLocalBioAuthSupported({
      success: (res) => {
        this.setData({
          authMethods: res.success ? ['Biometric', 'Password'] : ['Password']
        });
      },
      fail: (res) => {
        console.log('Error code:', res.error, res.errorMessage);
        this.setData({ authMethods: ['Password'] });
      }
    });
  }
});
```

<Tip>
  Always check biometric availability before showing biometric options in your UI to avoid confusing users on devices without biometric capabilities.
</Tip>

## Related APIs

<CardGroup cols={2}>
  <Card title="my.startLocalBioAuth" icon="fingerprint" href="/jsapi/device/biometric/my.startLocalBioAuth">
    Start biometric verification
  </Card>
</CardGroup>
