Face Authentication API for Web Apps

Integrate FACEIO facial authentication with fio.js. Create an app in the Console, load the widget, call enroll() and authenticate(), then map the returned Facial ID to your own backend session logic.

Connect to the FACEIO Console to create applications, manage APIs, and configure webhooks for enrollment, authentication, and Facial ID events.

Why Teams Choose FACEIO Instead of Building In-House

Add face authentication without building camera capture, liveness checks, or matching infrastructure from scratch.

Building facial authentication from scratch means handling liveness checks, anti-spoofing, recognition engine behavior, matching quality, and cross-browser camera capture before you can ship the actual product workflow. It is infrastructure work with security and privacy consequences.

FACEIO packages those layers into a managed API and browser SDK. Your application receives a Facial ID and authentication result, while your backend remains responsible for user mapping, session creation, authorization, and account recovery policy. Teams often pair this with the managed face authentication service for faster rollout.

Building In-House

  • Months of development time
  • Recognition engine evaluation and tuning
  • Ongoing maintenance for browser quirks
  • Consent, retention, deletion, and regional policy work

Using FACEIO API

  • Compact browser SDK integration
  • Liveness checks included in the capture flow
  • SDK handles camera & cross-device compatibility
  • Backend-friendly Facial ID and payload mapping

The bottom line: FACEIO handles the browser capture and facial authentication workflow, while your application owns session and authorization logic. If you want the broader architecture view, see biometric authentication for web apps.

Core API Capabilities

The FACEIO API and fio.js SDK expose two core methods that cover the end-to-end authentication lifecycle. For endpoint-level controls, see the REST API reference.

  • enroll()

    Starts the enrollment flow in the FACEIO widget. After explicit user consent, the configured facial recognition engine creates the non-reversible biometrics hash or application index entry, and FACEIO returns a unique Facial ID. Your backend stores that Facial ID against the user record.

  • authenticate()

    Starts a live authentication flow, checks liveness, and returns the Facial ID with any associated payload after a successful match. Your backend can then validate the result and create a session, including passwordless sign-in flows described in Biometric Login for Web Apps.

Payloads and Session Handling

You can attach a developer-defined payload (for example, { user_id: "abc123" }) during enrollment. The same payload is returned after successful authentication, so you can map the authentication event to your internal user record without extra lookups, then emit downstream audit events via webhooks.

Integrating the Face Authentication API in Four Steps

Frontend integration is intentionally small. The SDK widget handles camera permissions, capture UI, and liveness checks inline, so your application does not need to implement those layers itself.

// Step 1 - embed the SDK in your page
<script src="https://cdn.faceio.net/fio.js"></script>

// Step 2 - initialize with your public App ID
const faceio = new faceIO('YOUR_APP_ID');

// Step 3 - enroll a new user
faceio.enroll({ locale: 'auto', payload: { userId: 'abc123' } });

// Step 4 - authenticate on return visits
faceio.authenticate({ locale: 'auto' })
  .then((data) => sendToBackend(data.facialId, data.payload))
  .catch((err) => handleError(err));

After a successful authenticate() call, send the returned facialId and payload to your server to create a trusted session. For a full walkthrough, see the integration guide, webhooks documentation, and security best practices.

Built-in Security & Liveness Detection

The FACEIO API applies a full security stack on each authentication event. These controls are enabled by default, with no extra configuration required. For platform posture details, review the Trust Center.

  • Liveness & Anti-Spoofing

    Each capture is checked for live human presence and designed to reject common presentation attacks, including photos, printed images, prerecorded video, screen replays, synthetic media, and mask attempts.

  • Private API Key Validation

    Your backend validates authentication events using your private REST API key. Keep that key on the server so forged or replayed frontend responses are not treated as valid sessions.

  • Application-Scoped Facial IDs

    Each App ID is isolated. Facial IDs, payloads, and recognition-engine indexes are scoped to the application, while platform-level rate limiting helps reduce brute-force attempts.

Best practice: Do not expose your private API key in client-side code. Keep session validation and Facial ID mapping on your server. See Security Best Practices and Privacy Best Practices for implementation guidance.

Choosing Your Implementation Pattern

Most FACEIO integrations use one of two patterns, depending on trust and compliance requirements:

Frontend-Only Pattern

Suitable for lower-risk flows and prototypes. enroll() and authenticate() run in the browser, and the returned Facial ID is used directly to identify the user and start a client-side session.

Fast to ship, but session trust remains client-side.

Frontend + Backend Verification Recommended

After authenticate() returns a Facial ID in the frontend, your app sends it to your backend through an authenticated API call. The server validates the result with your private key, resolves the user via payload mapping, and issues a signed session token. This pattern aligns with passwordless authentication deployments.

Conclusion

FACEIO provides the browser capture and facial authentication flow without requiring you to build the recognition stack. The standard integration uses one script tag, the enroll() and authenticate() SDK methods, and backend result validation. Continue with Getting Started and the Integration Guide.

Connect FACEIO to Your Login Flow

Create a FACEIO app, copy the public App ID, load fio.js, and connect enrollment and authentication results to your backend session flow.

Public App ID setup
Framework-agnostic SDK
Server-side validation