๐ฅ Download
โฌ๏ธ Download finger.js๐ How to Use
๐น Async/Await Example
<script src="finger.js"></script>
<script>
async function register() {
const id = await finger("#output").register();
if (id) alert("โ
Registered with ID: " + id);
}
async function login() {
const ok = await finger("#output").login();
if (ok) alert("โ
Login successful!");
}
</script>
๐น Classic Callback Example
<script src="finger.js"></script>
<script>
function register() {
finger("#output").register(function(id) {
if (id) alert("โ
Registered with ID: " + id);
});
}
function login() {
finger("#output").login(function(ok) {
if (ok) alert("โ
Login OK!");
});
}
</script>
๐งช Live Demo Examples
๐น Async/Await (Modern)
// Async/Await
async function registerAsync() {
const result = await finger("#output").register();
if (result) alert("โ
Registered!");
}
async function loginAsync() {
const ok = await finger("#output").login();
if (ok) alert("โ
Login successful!");
}
๐น Traditional Callback (Classic)
// Classic Callbacks
function registerClassic() {
finger("#output").register(function(result) {
if (result) alert("โ
Registered!");
});
}
function loginClassic() {
finger("#output").login(function(ok) {
if (ok) alert("โ
Login OK!");
});
}
๐ Notes
- Use over HTTPS or
localhost - Supports Android, Windows Hello, macOS Touch ID, iOS 17+