For the complete documentation index, see llms.txt. This page is also available as Markdown.

Biometric Authentication API

Enable fingerprint and Face ID authentication using the WebToNative JavaScript API. Add secure biometric login for Android and iOS apps.

You'll need to import the JavaScript file into your website before starting from this link.

This module explains the ways to use the Biometric authentication functions, where you can use the device's Touch/Face ID to unlock an app or use it to secure pages.

If you choose to handle biometrics yourself, the following JS APIs will be required.

Show Biometric option

Use the following code to show biometric in the app. If it is authenticated successfully, then the callback function will be called.

window.WTN.Biometric.show({
    prompt:"Authenticate to continue!",
    callback:function(data){
        /* data returns the object below 
        {
            isSuccess: true,
            secret: 'saved secret token'
        }
        */
        
    }
});
import { show } from "webtonative/Biometric";

show({
    prompt:"Authenticate to continue!",
    callback:function(data){
         /* data returns the object below 
        {
            isSuccess: true,
            secret: 'saved secret token'
        }
        */
    }
});

Biometric Auth Screen

Save secret

Use following code to save secret in the app. This secret will be returned when you show the biometric when user opens the app. Secret can be used for example to store a login token, using that token you can handle custom handling like get the user logged in.

Delete Secret

Use following code to delete secret in the app.

Check Status

Check status function will return if biometric is active.

Show Biometric without closing the app on cancel click - Android

This let's you open the prompt and clicking on cancel won't close the app

Function - biometricAuthWithDismissOnCancel - Available on Android from 30/06/25

Last updated