Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Use Face Liveness

Face Liveness creates hosted biometric verification sessions and returns the result associated with each session token.
Biometric images and results are sensitive personal data. Keep API keys and verification data on trusted server infrastructure.

Initialize the client

Create a dedicated client with the Face Liveness API key issued to your integration:
import { createClient } from "egov.js"; const client = createClient({ baseUrl: "https://hackathon-face-liveness-api.e.gov.ph", headers: { "x-api-key": process.env.FACE_LIVENESS_API_KEY!, }, });

Methods

The examples below use this authenticated Face Liveness client. See the quickstart for the general client pattern.
The API Reference tab documents the complete session request, hosted verification URL, path parameter, and result schema.

faceLiveness.createSession

POST /v1/liveness/session creates a biometric verification session and returns its session token and hosted verification URL.
import { faceLiveness } from "egov.js"; const session = await faceLiveness.createSession({ client, body: { action: "redirect", callback_url: "https://example.gov.ph/identity/liveness-complete", }, throwOnError: true, });

faceLiveness.getVerificationResult

GET /v1/liveness/result/{sessionToken} returns the biometric result associated with an existing session token.
import { faceLiveness } from "egov.js"; const result = await faceLiveness.getVerificationResult({ client, path: { sessionToken: session.token }, throwOnError: true, });