@techdacxi/capacitor-biometrics-plugin
v1.0.4
Published
Capacitor plugin that integrates native biometric authentication for both Android and iOS devices into the web application
Downloads
22
Readme
capacitor-biometrics
Capacitor plugin that integrates native biometric authentication for both Android and iOS devices into the web application
Install
npm install capacitor-biometrics-plugin
npx cap sync
API
checkBiometricsCapabilities()
tryToAuthenticate()
saveToken(...)
getToken(...)
deleteToken(...)
- Interfaces
checkBiometricsCapabilities()
checkBiometricsCapabilities() => Promise<BiometricsCheckResult>
Returns: Promise<BiometricsCheckResult>
tryToAuthenticate()
tryToAuthenticate() => Promise<BiometricsAuthResult>
Returns: Promise<BiometricsAuthResult>
saveToken(...)
saveToken(options: SaveTokenOptions) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------------------------------- |
| options
| SaveTokenOptions |
getToken(...)
getToken(options: GetTokenOptions) => Promise<GetTokenResult>
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| options
| GetTokenOptions |
Returns: Promise<GetTokenResult>
deleteToken(...)
deleteToken(options: GetTokenOptions) => Promise<void>
| Param | Type |
| ------------- | ----------------------------------------------------------- |
| options
| GetTokenOptions |
Interfaces
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 |