1.5.4 • Published 2 years ago

web-biometric v1.5.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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: "userEmailAddress@example.com",
			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);
	}
}
1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago