# Face Session Flow

**Note:** This feature requires an additional permission and must be explicitly requested

Face Session can be performed to validate a user using facial recognition based on an existing id photo. In order to use this feature you have to upload the id photo through our "[Face Session API](/docs/kyc/uqudo-api/face.md#face-session-api)". The API returns a temporary session id that is required to initialize the face session process. See the diagram sample below:

<figure><img src="/files/trcxkVvxBpBv3YRUBaQY" alt=""><figcaption></figcaption></figure>

Face session interface definition:

```javascript
try {
  const result = uqudoSdk.faceSession({
     	sessionId: string;
     	returnDataForIncompleteSession?: boolean;
     	maxAttempts?: number;
     	minimumMatchLevel?: number;
    	onSuccess?: (result) => {
	  // Result returned after a successful face session
	  console.log(result)
	};
	onError?: (error) => {
	  // Error returned from the face session process failure 
	  console.log(error)
	};
	onTrace?: (trace) => {
	  // trace events
	  console.log(trace)
	};
    	onFinally?: () => void;
     	assets?: IAssetsArg;
     	texts?: ITextsArg;
  });
} catch (error) {
}
```

Below the configuration options for face session:

<table><thead><tr><th width="180">Attribute</th><th width="357">Description</th><th>Required</th></tr></thead><tbody><tr><td>sessionId</td><td>Session id returned by the face session API</td><td>true</td></tr><tr><td>returnDataForIncompleteSession</td><td>When enabled, if the user or the SDK drops the session before completion and there was at least one failed facial recognition attempt, the SDK will return the partial data together with the <a href="/pages/YBbrmfyiRkHvTHn6zAec">OperationError object</a> in the data attribute, that will contain the same JWS string that is returned in a successful scenario</td><td>No. Default false</td></tr><tr><td>maxAttempts</td><td>Set the max failed facial recognition attempts before dropping the session.<br><strong>Note</strong>: only values between 1 and 3 are taken into consideration.</td><td>No. Default to 3</td></tr><tr><td>minimumMatchLevel</td><td>Defines the minimum match level that the facial recognition has to meet.</td><td>No. Default to 3</td></tr><tr><td>onSuccess</td><td>Callback function called after the process is done successfully. The result is a string, see "<a href="/pages/Gm4CHOMuofjG3oW73F4K">SDK result</a> (Face Object)" for details</td><td>false</td></tr><tr><td>onError</td><td>Callback function called when the process returns an error. See <a href="/pages/YBbrmfyiRkHvTHn6zAec">Operation Error</a></td><td>false</td></tr><tr><td>onTrace</td><td>Callback function called to send trace events. See <a href="/pages/tGQTMGOcpv3KxMPuI0D0">Analytics</a> for details. </td><td>false</td></tr><tr><td>onFinally</td><td>Callback function called after the process is done, successfully or unsuccessfully.</td><td>false</td></tr><tr><td>assets</td><td>List of assets</td><td>False. See <a href="/pages/S5qfXuFbRUdd9cmGzGHM">Asset Configuration</a></td></tr><tr><td>texts</td><td>List of texts</td><td>False. See <a href="/pages/LfOsalospU60gYnnmMfM">Text Configuration</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uqudo.com/docs/kyc/uqudo-sdk/integration/web/face-session-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
