Vulos Documentation
  • Identity
    • Welcome to the Vulos Identity Documentation!
    • Quick Start
    • Organizations
    • Scopes and Claims
  • Reference
    • Identity JavaScript SDK
      • The Base Package
        • KYC
          • KycStatus
          • KycInstance
          • KycDetails
          • KycApi
        • Profile
          • UserReference
          • ProfileApi
        • Cache
        • Authentication
          • Application
          • BaseAuth
          • User
          • UserInfo
          • BaseApi
        • Organizations
          • Organization
          • OrganizationMembership
            • OrganizationMembershipWithMetadata
          • OrganizationRole
          • OrganizationApi
      • The Backend Auth Package
        • CodeVerifier
        • BackendAuth
      • The Frontend Auth Package
        • IFrameRefresh
        • StateVerifier
        • FrontendAuth
    • Organization API
      • Organizations
      • Memberships
        • Roles
    • Profile API
    • KYC API
Powered by GitBook
On this page
  • Interfaces
  • KycStatusResponse
  • KycDetailsResponse
  • Methods
  • constructor(app, endpoint)
  • async status(kycId)
  • async list(page, pageSize)
  • async upload(selfiePicture, idCardPicture)
  • async create(selfiePicture, idCardPicture, webhook)
  1. Reference
  2. Identity JavaScript SDK
  3. The Base Package
  4. KYC

KycApi

PreviousKycDetailsNextProfile

Last updated 2 years ago

This class implements BasicApi.

You need or to access some parts of this API.

This is a JavaScript implementation of the .

For ease of use we recommend using the ApplicationReference object for interaction instead.

Interfaces

KycStatusResponse

interface KycStatusResponse {
    complete: boolean,
    success: boolean,
    distance: number,
    createdAt: string,
    completedAt: string,
    webhook: string|null
}

KycDetailsResponse

interface KycDetailsResponse {
    idCardPictureUrl: string,
    selfiePictureUrl: string
}

Methods

constructor(app, endpoint)

Create a KYC API object.

  • app should be an instance of the ApplicationReference object.

  • endpoint should be the Vulos Identity endpoint.

const kycApi = new KycApi(appRef, endpoint)

async status(kycId)

Get the status of a KYC verification instance by ID.

const status = await kycApi.status(kycId)

async list(page, pageSize)

Get a list of all the KYC verification instance IDs.

  • page defaults to 0;

  • pageSize defaults to 10;

The result is an array of KYC Instance IDs.

const first10 = await kycApi.list()

async upload(selfiePicture, idCardPicture)

Upload KYC verification details for later use, both of the arguments must be objects that inherit from Blob (like File).

const details = await kycApi.upload(selfieFile, idCardFile);

async create(selfiePicture, idCardPicture, webhook)

The result is the ID of the KYC Instance that was created.

The webhook must be in the application's redirect URLs otherwise the server will return the "Bad Request" response.

const kycId = await kycApi.create(selfieFile, idCardFile, 'http://example.com/webhook');

The result implements the interface.

This method's response has the kyc:status prefix.

This method's response has the kyc:list prefix.

The result implements the interface.

Make a KYC verification request, the first two arguments may be objects that inherit from Blob or URLs returned by the method, the webhook argument is optional.

KycStatusResponse
KycDetailsResponse
upload()
KYC API
cache
cache
kyc:read
kyc:write