12345678import { 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!, }, });
faceLiveness.createSessionPOST /v1/liveness/session creates a biometric verification session and returns its session token and hosted verification URL.12345678910import { 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.getVerificationResultGET /v1/liveness/result/{sessionToken} returns the biometric result associated with an existing session token.1234567import { faceLiveness } from "egov.js"; const result = await faceLiveness.getVerificationResult({ client, path: { sessionToken: session.token }, throwOnError: true, });