SDK Integration

SDK Integration

Integrating zKYC into your application is designed to be straightforward. Developers can treat zKYC as a simple SDK call that launches a secure verification process, returning a reusable proof at the end.

zKYC Framework Compatibility

zKYC works seamlessly with the most popular web development frameworks such as Next.js and Vite, as well as many other JavaScript frameworks, making integration simple and flexible for developers.

Installation:

Install zKYC
npm i zkyc-lfg@latest

Function:

After installing the zkyc-lfg package the zKYCProcess function take as an argument:

  • UserID
  • Environment Key test or production
zKYC Flow Diagram

Services

zKYC provides a identity verification by default in addition zKYC provides extra services like OCR and Liveliness.

Redirection Mechanism

zKYC provides a custom pending and failure page to redirect your user in case failure or a pending responce

ZKYCProcess Function
"use client";
import { ZKYCProcess } from 'zkyc-lfg';

export default function Home() {
  return (
    <main>
      <div>
        <h1>KYC Process</h1>
      </div>

      <div>
        <div
          onClick={() =>
            ZKYCProcess(
              "df232ee0-b0e9-479d-9d4e-bb97e4d77472", // user/session id
              "test_f891b652bbf3005a23fffc8b3f78ada4ee8424eca4bf553d", // test API key
              OCR, // values are either "OCR", "FaceLive",
              "https://zkycsite.vercel.app/failure", // redirect on failure
              "https://z-kyc-sdk.vercel.app/pending"  // redirect on success/pending
            )
          }
         >
          <h2 className="mb-3 text-2xl font-semibold">
            Start KYC Process{" "}
            <span>
              -&gt;
            </span>
          </h2>
          <p>
            Click here to start the KYC process.
          </p>
        </div>
      </div>
    </main>
  );
}

API Usage

This code is showing how a developer checks the status of a KYC verification using an API endpoint.

Install zKYC

const res = await fetch(
    https://sdk.zkyc.tech/api/kyc/verifications/${userID},
  {
    method: 'GET',
    headers: {
      'x-user-id': clientid,
      'x-api-key': key,
    },
    }
);

Required Parameters

ParameterDescription
userIdUnique identifier of the user/session.
apiKeyYour API key (test or production).
serviceTypeThe type of verification (options: OCR, Liveness, All, or null for basic IDV).
failurePageURL to redirect the user if verification fails.
pendingPageURL to redirect the user when verification is pending or complete.