---
description: Node API Library for KYC
---

# NodeJS API Library

## Faceki API Client V2

The Faceki API Client V2 is a TypeScript library that simplifies interactions with the Faceki API for Know Your Customer (KYC) verifications. It provides a straightforward way to initiate KYC verifications, retrieve verification records, perform face matching, and more.

### Installation

To use the Faceki API Client V2 in your project, install it via npm:

```
npm install @faceki/nodejs-api-client
```

### Usage

1.  Import the `FacekiAPIClientV2` class:

    ```
    import FacekiAPIClientV2 from '@faceki/nodejs-api-client';
    ```
2.  Initialize an instance of the client with your credentials:

    ```
    const client = new FacekiAPIClientV2('your_client_id', 'your_client_secret');
    ```
3. Utilize the available methods to interact with the Faceki API:
   *   **Initiate Multi-Document KYC Verification**:

       ```
       const multiKycResponse = await client.requestMultiDocumentKYC(
         selfieImageBuffer,
         idFrontImageBuffer,
         idBackImageBuffer,
         dlFrontImageBuffer,
         dlBackImageBuffer,
         ppFrontImageBuffer
       );
       ```
   *   **Initiate Single-Document KYC Verification**:

       ```
       const singleKycResponse = await client.requestSingleDocumentKYC(
         selfieImageBuffer,
         docFrontImageBuffer,
         docBackImageBuffer
       );
       ```
   *   **Generate KYC Verification Link**:

       ```
       const kycLink = await client.generateKYCLink(
        expireTime,
        applicationId,
        redirect_url,
        document_optional,
        require_additional_doc);
       ```
   *   **Fetch KYC Verification Summary**:

       ```
       const summary = await client.getKycSummary();
       ```
   *   **Fetch KYC Records by Link ID**:

       ```
       const kycRecordsByLink = await client.getKYCrecordsByLink(linkId);
       ```
   *   **Fetch KYC Records by Request ID**:

       ```
       const kycRecordsByRequestId = await client.getKYCRecordByRequestId(requestId);
       ```
   *   **Fetch KYC Records by Reference ID**:

       ```
       const kycRecordsByReference = await client.getKYCRecordByReference(referenceId);
       ```
   *   **Fetch KYC Records by Selfie**:

       ```
       const kycRecordsBySelfie = await client.getKYCrecordsBySelfie(selfieImageBuffer);
       ```

### Error Handling

The client manages various response statuses and errors, throwing custom error messages when necessary. Make sure to handle these errors appropriately in your code.

### Contributing

Contributions are welcome! If you encounter issues, have suggestions, or wish to improve the client, please open issues and pull requests.
