@face-auth/face-id
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Face Auth

Face Auth


102 items Last update: September 4th, 2024 Updated for Node 20.17.0

Introduction

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.

Quick Starting Example

This example shows the basics of how to use the package. With these simple steps, you can start testing the platform right away.

Install the package from command line

npm install @face-auth/face-id

Import the package and create the API's invoker

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);

Register a new face

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);

Identify an already registered face

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.

Getting started

Getting a token

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.

Installation

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

How to use it

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

Basic Usage

Frequently Asked Questions (FAQ)

  • FAQ: Answers to common questions about the platform.

Dashboard

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

Dashboard screenshot

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.

Documentation

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.

Links

Issues, questions or feedback

If you have any issues, questions, or feedback, we would love to hear from you at support@face-auth.me.

Package Sidebar

Install

npm i @face-auth/face-id

Weekly Downloads

3

Version

0.1.3

License

MIT

Unpacked Size

17.8 kB

Total Files

10

Last publish

Collaborators

  • daniel-fa