# Welcome

Welcome to the FaceVerify Documentation! Here, you'll discover a comprehensive overview of all the powerful features FaceVerify offers to help you verify your customers and employees, or to prevent fraudulent activities.

Explore how FaceVerify can seamlessly integrate with your needs, see our advanced verification tools in action, and get all the guidance you need to make the most of our platform.

### Jump right in

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Getting Started</strong></td><td>Setup your Integration</td><td><a href="/files/UHF7zjwcq36zmrwja3ub">/files/UHF7zjwcq36zmrwja3ub</a></td><td></td><td><a href="/pages/CyH2xJQs9yWJ1S8BYNav">/pages/CyH2xJQs9yWJ1S8BYNav</a></td></tr><tr><td><strong>Easy SDK</strong></td><td>Go Live with our Web SDK</td><td><a href="/files/vxs1ER5I8VkIA0IaOqfo">/files/vxs1ER5I8VkIA0IaOqfo</a></td><td></td><td><a href="/pages/7aUFmnCMx9m4smGncsXL">/pages/7aUFmnCMx9m4smGncsXL</a></td></tr><tr><td><strong>API Integration</strong></td><td>Control All Flow directly</td><td><a href="/files/WqTZslyWgLz3XWQj63oY">/files/WqTZslyWgLz3XWQj63oY</a></td><td></td><td><a href="/pages/JjjojIyKxaiBPzzLwvtg">/pages/JjjojIyKxaiBPzzLwvtg</a></td></tr></tbody></table>


# Quickstart

<figure><img src="/files/2pnwDoXjk8wJnwRb1S84" alt=""><figcaption></figcaption></figure>

Choose the plan that best suits your needs, and click "Start" to begin creating your account.

{% hint style="info" %}
Already Created Account? Head Over to [Integration](/getting-started/integration) Section, to set your new integration
{% endhint %}

### Create Account

Creating a new account with FaceVerify is quick and simple! Just provide some basic information like your name and email, and you're all set to get started.

<div data-full-width="false"><figure><img src="/files/6JNHamVPkyLBGSwyhzcS" alt=""><figcaption></figcaption></figure></div>


# Setup new Integration

Now that your account is created, it’s time to set up a new integration. An integration works like a placement where you choose which FaceVerify services you want to use and where they will be applied.

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

{% hint style="info" %}
Once your are logged in, Select Integration Tab to set up your new integration
{% endhint %}

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

{% hint style="info" %}
Click on Add Integration and fill up the information asked
{% endhint %}

<figure><img src="/files/6Vw5NoNdhaanDmOPnmJl" alt=""><figcaption></figcaption></figure>

| Field Names       | Meaning                                                                                                                                                                     |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Integration Name  | This is only for your internal reference                                                                                                                                    |
| Callback URL      | This is the url/website where your customers/users will be redirected after completing verification.                                                                        |
| Webhook URL       | <p>This is where you will get notified about verification events by a POST request, like :<br>Verification started, Partial done, submitted, Rejected, Approved.</p>        |
| Verification Type | This basically refers to your verification needs, it can be both face and id or face only and even documents only.                                                          |
| Set as Production | By default it's off, which means you can use this for test proposes and to understand verification flow,  once you are ready to go live, you can turn on to production mode |


# SDK Integration

You can use our npm package directly for react/nextjs/vuejs.. on applicable projects

{% embed url="<https://www.npmjs.com/package/faceverify-sdk-react>" %}


# API Integration

You can use this API to create new sessions or get existing session link

### Generate hmac signature

{% tabs %}
{% tab title="NodeJS" %}

```javascript
const crypto = require('crypto');

const generateHmac = (httpMethod, url, body, contentType, xAuthClient, secretKey) => {
  const requestUrl = new URL(url);
  const requestPath = requestUrl.pathname;
  const queryParams = requestUrl.searchParams.toString();

  const dataToHash = `${httpMethod}\n${requestPath}\n${queryParams}\n${xAuthClient}\n${contentType}\n${body}`;

  const hmac = crypto.createHmac('sha256', secretKey);
  hmac.update(dataToHash);
  return hmac.digest('hex');
};
let httpMethod = "POST";
const url = "https://start.faceverify.ai/api/v1/session";
const body = JSON.stringify({
    country: country,
    uniqueIdentifier,
});
const contentType = "application/json";
//xAuthClient is your apiKey
const xAuthClient = "xxx-xxx-xxx-xxx-xxx"
const secretKey = "xxx-xxx-xxx-xxx-xxx";
const hmacSignature = generateHmac(httpMethod,url,body,contentType,xAuthClient,secretKey);
console.log(hmacSignature);
```

{% endtab %}

{% tab title="Python" %}

```python
import hashlib
import hmac
from urllib.parse import urlparse

def generate_hmac(http_method, url, body, content_type, x_auth_client, secret_key):
    parsed_url = urlparse(url)
    request_path = parsed_url.path
    query_params = parsed_url.query

    data_to_hash = f"{http_method}\n{request_path}\n{query_params}\n{x_auth_client}\n{content_type}\n{body}"
    hmac_signature = hmac.new(secret_key.encode('utf-8'), data_to_hash.encode('utf-8'), hashlib.sha256).hexdigest()
    return hmac_signature

http_method = "POST"
url = "https://start.faceverify.ai/api/v1/session"
body = '{"country": "US", "uniqueIdentifier": "user123"}'
content_type = "application/json"
x_auth_client = "xxx-xxx-xxx-xxx-xxx"  # Your API key
secret_key = "xxx-xxx-xxx-xxx-xxx"  # Your secret key

hmac_signature = generate_hmac(http_method, url, body, content_type, x_auth_client, secret_key)
print(hmac_signature)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
function generateHmac($httpMethod, $url, $body, $contentType, $xAuthClient, $secretKey) {
    $parsedUrl = parse_url($url);
    $requestPath = $parsedUrl['path'];
    $queryParams = isset($parsedUrl['query']) ? $parsedUrl['query'] : '';

    $dataToHash = $httpMethod . "\n" . $requestPath . "\n" . $queryParams . "\n" . $xAuthClient . "\n" . $contentType . "\n" . $body;

    $hmacSignature = hash_hmac('sha256', $dataToHash, $secretKey);
    return $hmacSignature;
}

$httpMethod = "POST";
$url = "https://start.faceverify.ai/api/v1/session";
$body = json_encode(array(
    'country' => 'US',
    'uniqueIdentifier' => 'user123'
));
$contentType = "application/json";
// $xAuthClient is your API key
$xAuthClient = "xxx-xxx-xxx-xxx-xxx";
$secretKey = "xxx-xxx-xxx-xxx-xxx"; // Your secret key

$hmacSignature = generateHmac($httpMethod, $url, $body, $contentType, $xAuthClient, $secretKey);
echo $hmacSignature;
?>
```

{% endtab %}
{% endtabs %}

{% openapi src="/files/x2MyBaMZMX3iyeLJQEZq" path="/session" method="post" %}
[faceverify1.yaml](https://1053046052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDvMwHcGuRndvUobPaqDt%2Fuploads%2FcaiwM2qtdhD560WMnXGM%2Ffaceverify1.yaml?alt=media\&token=bd6c0944-c88e-4f66-b241-63776f753d32)
{% endopenapi %}


