> ## Documentation Index
> Fetch the complete documentation index at: https://docs.authentica.sa/llms.txt
> Use this file to discover all available pages before exploring further.

# Face verification

> Compare a reference face image with a real-time image.

`authentica.face.verify()` checks whether a real-time face image matches the reference image you registered for a user.

```ts theme={null}
const result = await authentica.face.verify({
  userId: 'user_123',
  registeredFaceImage, // Base64-encoded reference image
  queryFaceImage,      // Base64-encoded real-time image
});

if (!result.success) {
  console.log('Face verification could not be completed.');
} else if (result.result) {
  console.log('Face match confirmed.');
} else {
  console.log('Faces do not match.');
}
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `userId` | `string` | Yes | Your unique identifier for the user. |
| `registeredFaceImage` | `string` | Yes | Base64-encoded reference image. |
| `queryFaceImage` | `string` | Yes | Base64-encoded real-time image captured by your application. |

The SDK checks only that each field is a non-empty string. The API decides whether the images are valid.

## Response

```json theme={null}
{
  "success": true,
  "userId": "user_123",
  "result": true
}
```

**success** `boolean`

Whether the API processed the verification request.

**userId** `string`

The user ID returned by the API.

**result** `boolean`

`true` if the faces match, `false` if they do not.

Check `success` first. `success: false` means the verification could not be completed, not that the faces do not match. Only when `success` is `true` does `result` tell you whether the faces match. A `result` of `false` is a normal outcome, not an error.

> [!WARNING]
>
> Face images are biometric data. Never log Base64 image payloads, and avoid storing them unnecessarily. Limit upload and request sizes in your backend; the SDK does not impose a size limit.

See also: [Face Verification Workflow](https://docs.authentica.sa/guides/face-verification-workflow.md) and the [Verify By Face](https://docs.authentica.sa/api-reference/face-verification/verify-by-face.md) API Reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.