Face-Auth is a robust facial recognition authentication system designed for seamless integration into web applications. It enables secure and user-friendly login experiences by leveraging cutting-edge face recognition technology.
The @face-auth/face-id
package simplifies the integration of facial recognition-based authentication into your web applications. It provides seamless access to Face-Auth's powerful APIs.
This example shows the basics of how to use the package. With these simple steps, you can start testing the platform right away.
npm install @face-auth/face-id
import { FaceId } from "@face-auth/face-id";
// Your registered domain in the platform.
// For testing purpose you can use 4demo.face-auth.me.
const domain = '4demo.face-auth.me';
// Your client token generated by the platform.
// For testing purpose you can use 6f08e5f7-c72c-44fe-9361-e3234164754b.
const clientToken = '6f08e5f7-c72c-44fe-9361-e3234164754b';
const faceId = new FaceId(domain, clientToken);
Given a HTML canvas:
<canvas id="canvas" width="5" height="5"></canvas>
We can register the face with:
// Get the canvas object
const canvas = document.getElementById("canvas");
// Identification used to register the face
const faceIdentifier = 'face_id_123';
// Format type of the image
const imageType = 'image/png';
// Convert canvas to blob async to register the face
canvas.toBlob(async (blob) => {
const response = await faceId.register(faceIdentifier, blob, imageType);
console.log("Success: ", response.success); // boolean
console.log("Domain: ", response.data.domain); // string
console.log("Face identifier: ", response.data.faceId); // string
}, imageType);
Given a HTML canvas:
<canvas id="canvas" width="5" height="5"></canvas>
We can identify the face with:
// Get the canvas object
const canvas = document.getElementById("canvas");
// Format type of the image
const imageType = 'image/png';
// Convert canvas to blob async to register the face
canvas.toBlob(async (blob) => {
const response = await faceId.identify(blob, imageType);
console.log("Success: ", response.success); // boolean
console.log("Face identified: ", response.data.found); // boolean
console.log("Face identifier: ", response.data.faceId); // string
}, imageType);
Note: For a production setup, follow the detailed steps to register a domain and generate your own unique token, ensuring optimal performance.
To start using the @face-auth/face-id
package, you'll need an API token. This token is essential for authenticating your requests with the Face-Auth platform.
- Sign up: Create an account on the Face-Auth platform website.
- Register your domain: Register your application's domain.
- Generate token: After registering your domain, the platform will sent you by email your unique API token.
Install the @face-auth/face-id
package using npm:
npm install @face-auth/face-id
Alternatively, if you are using Yarn:
yarn add @face-auth/face-id
For a deepler detailed information about this npm package , please review the oficial documentation at
Introduction
- Overview: An overview of how the platform works.
Installation
- Prerequisites: Before installing the package, ensure you have the necessary tools and environment set up.
-
Installation guide: Step-by-step instructions on how to install and configure the
@face-auth/face-id
package in your project.
Initial setup
- Acquisition of client token and domain: Instructions on obtaining your client token and registering your domain.
- Authentication configuration: How to configure authentication in your application.
Basic Usage
- Basic code example: A quick code example to help you get started.
- Getting Started: A step-by-step guide to getting started with Face-Auth.
Frequently Asked Questions (FAQ)
- FAQ: Answers to common questions about the platform.
Once you have integrated the package into your application, you can monitor its performance and see user metrics on the Face-Auth dashboard.
Access the platform dashboard here
Face-Auth dashboard provides several powerful features to help you manage and monitor your usage:
-
View Historical Usage Metrics: Track and analyze authentication requests over time. The dashboard displays detailed metrics on user activity, success rates, and system performance.
-
Reset Client Token: If your client token is ever lost or compromised, you can quickly reset it through the dashboard. This ensures the security of your application while maintaining uninterrupted service.
For more detailed information on how to use the @face-auth/face-id
package, including advanced configuration options and API reference, check out our comprehensive documentation.
If you have any issues, questions, or feedback, we would love to hear from you at support@face-auth.me
.