Capacitor plugin that integrates native biometric authentication for both Android and iOS devices into the web application
npm install @techdacxi/capacitor-biometrics-pluginCapacitor plugin that integrates native biometric authentication for both Android and iOS devices into the web application
``bash`
npm install capacitor-biometrics-plugin
npx cap sync
* checkBiometricsCapabilities()
* tryToAuthenticate()
* saveToken(...)
* getToken(...)
* deleteToken(...)
* Interfaces
`typescript`
checkBiometricsCapabilities() => Promise
Returns: Promise<BiometricsCheckResult>
--------------------
`typescript`
tryToAuthenticate() => Promise
Returns: Promise<BiometricsAuthResult>
--------------------
`typescript`
saveToken(options: SaveTokenOptions) => Promise
| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options | SaveTokenOptions |
--------------------
`typescript`
getToken(options: GetTokenOptions) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| options | GetTokenOptions |
Returns: Promise<GetTokenResult>
--------------------
`typescript`
deleteToken(options: GetTokenOptions) => Promise
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| options | GetTokenOptions |
--------------------
#### BiometricsCheckResult
| Prop | Type | Description |
| ------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status | string | The result of the biometric capabilities of the device. Can be one of the following: 'success': This means the device has biometric capabilities and the user has enrolled their biometric data (face or fingerprint). This means the prompt can be launched. 'failed': This means the device has no biometric capabilities. This is accompanied by an error message. 'errorMessage': The reason why the process didn't work. |
| errorMessage | string | |
#### BiometricsAuthResult
| Prop | Type |
| ------------------ | ------------------- |
| status | string |
| errorMessage | string |
#### SaveTokenOptions
| Prop | Type |
| ------------- | ------------------- |
| token | string |
| account | string |
#### GetTokenResult
| Prop | Type |
| ----------- | ------------------- |
| token | string |
#### GetTokenOptions
| Prop | Type |
| ------------- | ------------------- |
| account` | string |