web-biometric
v1.5.4
Published
login to you websites using device fingerprint,lock
Downloads
13
Maintainers
Readme
Web Biometric Authentication
Installation
yarn add web-biometric
login with device fingerprint
Usage
import { StringToUint8Array, Challenge } from "web-biometric";
const options = {
publicKey:{
rp: {
name: "Web App Name",
id: "my-website.com",
},
user: {
id: StringToUint8Array("user-uuid-with-16-char-length"),
name: "[email protected]",
displayName: "User Display Name"
},
pubKeyCredParams: [{
type: "public-key",
alg: -7
}],
attestation: "none",
timeout: 60000,
// these option should be provided from server
challenge: Challenge("this-is-challenge-text-and-should-be-long"),
authenticatorSelection: {
authenticatorAttachment: "platform",
userVerification: "required",
}
}
}
const registerBiometricFunction = () => {
try {
const { credential } = await Register(options);
const base64EncodedId = credential.id;
console.log(base64EncodedId)
} catch (err) {
console.error(err);
}
}