Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ChrisCore1/inventario_sud/llms.txt

Use this file to discover all available pages before exploring further.

Inventario SUD includes an optional facial recognition login powered by @vladmandic/human, a browser-based AI library that runs entirely on your device. When you register your biometric, the library captures a 1024-dimension face embedding from your camera feed and stores it in the database. At login, your live embedding is compared against stored vectors using pgvector cosine distance — if the closest match is below a threshold of 0.25, you are signed in without entering a password.

Register your biometric (first time)

Before you can use facial login, you must capture and save your face vector from the Configuración page. You must already be signed in with your password to do this.
1

Sign in with your password

Go to /login and sign in normally with your email and password.
2

Navigate to Configuración

Open the Configuración section from the sidebar or navigation menu.
3

Open the biometric scanner

Click the biometric setup button (labelled Scanner or showing a face/scan icon). The facial recognition panel opens.
4

Allow camera access

When your browser prompts you to allow camera access, click Allow. The scanner starts loading the AI model — this may take a few seconds on first load.
5

Capture your face vector

Click ENCENDER ESCÁNER to activate the camera. Position your face clearly in the frame. When the status changes to Rostro fijado. Listo para capturar, click GUARDAR ROSTRO. The system sends your 1024-dimension embedding to the server and saves it to your account.
6

Confirm success

The status display changes to ¡ÉXITO! Rostro guardado. Your biometric is now active and you can use facial login on future visits.

Sign in with facial recognition

Once your biometric is registered, you can sign in from the login page without entering your password.
1

Navigate to the login page

Go to /login.
2

Click Ingresar con Reconocimiento Facial

In the OPCIONAL section at the bottom of the login form, click Ingresar con Reconocimiento Facial. The biometric login panel opens.
3

Allow camera access

Grant camera permission when your browser prompts you. The AI model loads and begins analyzing your camera feed.
4

Let the scanner detect your face

Click ENCENDER ESCÁNER and position your face in frame. Wait until the status reads Rostro fijado. Listo para capturar, then click VERIFICAR IDENTIDAD.
5

Authentication result

The system compares your live embedding against all registered face vectors using cosine similarity. If the closest match has a distance below 0.25, you are signed in automatically and redirected to /panel. If no match is found, an error is shown and you can try again or sign in with your password instead.
Facial recognition requires adequate lighting and a clear, unobstructed view of your face. Poor lighting, face coverings, or extreme angles can prevent a successful match.
If recognition fails repeatedly, you can recalibrate your biometric from Configuración by going through the registration steps again. Saving a new face vector overwrites the previous one.

API reference

The biometric feature is backed by a single endpoint that handles both registration and login. Endpoint: POST /api/biometria

Register a face vector

Saves or overwrites the biometric for a specific user. Requires an active session.
{
  "action": "register",
  "userId": "42",
  "vector": [0.021, -0.134, 0.087, "...1024 values total"]
}
Success response:
{
  "success": true,
  "message": "Biometría guardada exitosamente"
}

Authenticate with a face vector

Finds the closest stored face vector and returns the matching user if the cosine distance is below 0.25.
{
  "action": "login",
  "vector": [0.021, -0.134, 0.087, "...1024 values total"]
}
Success response (match found):
{
  "success": true,
  "user": {
    "id": 42,
    "email": "[email protected]",
    "name": "Juan Pérez"
  }
}
Failure response (no match or distance ≥ 0.25):
{
  "success": false,
  "error": "Rostro no reconocido"
}

Build docs developers (and LLMs) love