npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@venturialstd/kyc

v0.0.7

Published

KYC (Know Your Customer) Management Module for Venturial

Readme

@venturialstd/kyc

KYC (Know Your Customer) Management Module for Venturial

Overview

This module provides comprehensive KYC (Know Your Customer) functionality for managing user verification, document uploads, and compliance tracking in fintech applications.

Features

  • KYC Profile Management: Track user verification status and personal information
  • Document Management: Upload and verify identity documents
  • Verification Tracking: Monitor individual verification steps and checks
  • Multiple Verification Levels: Support for basic, intermediate, advanced, and full verification
  • Status Management: Track KYC status from pending to approved/rejected
  • Provider Integration: Support for external KYC providers (AIPRISE, JUMIO, ONFIDO, etc.)

Installation

npm install @venturialstd/kyc

Usage

Module Setup

import { KYCModule } from '@venturialstd/kyc';

@Module({
  imports: [KYCModule.forRoot()],
})
export class AppModule {}

Basic Usage

import { KYCService, KYC_STATUS } from '@venturialstd/kyc';

@Injectable()
export class MyService {
  constructor(private readonly kycService: KYCService) {}

  async checkUserKYC(userId: string) {
    const isCompleted = await this.kycService.isKYCCompleted(userId);
    return isCompleted;
  }

  async updateKYCStatus(profileId: string, status: KYC_STATUS) {
    return this.kycService.updateStatus(profileId, status);
  }
}

Entities

KYCProfile

Main entity that tracks KYC verification for a user.

Key Fields:

  • userId: Reference to the user
  • status: Current KYC status (PENDING, APPROVED, REJECTED, etc.)
  • verificationLevel: Level of verification (NONE, BASIC, INTERMEDIATE, ADVANCED, FULL)
  • Personal information (firstName, lastName, dateOfBirth, etc.)
  • Address information (addressLine1, city, country, etc.)

KYCDocument

Stores uploaded documents for KYC verification.

Key Fields:

  • kycProfileId: Reference to KYC profile
  • documentType: Type of document (PASSPORT, DRIVER_LICENSE, etc.)
  • side: Document side (FRONT, BACK, BOTH)
  • status: Document verification status
  • fileUrl: URL to stored document file

KYCVerification

Tracks individual verification steps/checks within the KYC process.

Key Fields:

  • kycProfileId: Reference to KYC profile
  • verificationType: Type of verification (IDENTITY, ADDRESS, DOCUMENT, etc.)
  • status: Verification status
  • provider: External KYC provider name
  • confidenceScore: Confidence score (0-100)

Constants

KYC_STATUS

enum KYC_STATUS {
  PENDING = 'PENDING',
  IN_PROGRESS = 'IN_PROGRESS',
  SUBMITTED = 'SUBMITTED',
  UNDER_REVIEW = 'UNDER_REVIEW',
  APPROVED = 'APPROVED',
  REJECTED = 'REJECTED',
  EXPIRED = 'EXPIRED',
  REQUIRES_UPDATE = 'REQUIRES_UPDATE',
}

KYC_VERIFICATION_LEVEL

enum KYC_VERIFICATION_LEVEL {
  NONE = 'NONE',
  BASIC = 'BASIC',
  INTERMEDIATE = 'INTERMEDIATE',
  ADVANCED = 'ADVANCED',
  FULL = 'FULL',
}

KYC_DOCUMENT_TYPE

enum KYC_DOCUMENT_TYPE {
  PASSPORT = 'PASSPORT',
  DRIVER_LICENSE = 'DRIVER_LICENSE',
  NATIONAL_ID = 'NATIONAL_ID',
  // ... and more
}

Services

KYCService

Main service for managing KYC profiles.

Methods:

  • findByUserId(userId: string): Get KYC profile by user ID
  • createOrUpdateProfile(userId: string, data: Partial<KYCProfile>): Create or update profile
  • updateStatus(profileId: string, status: KYC_STATUS, reviewedBy?: string): Update KYC status
  • updateVerificationLevel(profileId: string, level: KYC_VERIFICATION_LEVEL): Update verification level
  • isKYCCompleted(userId: string): Check if user has completed KYC
  • getVerificationLevel(userId: string): Get user's verification level

KYCProviderService

Service for managing external KYC provider integrations.

Methods:

  • registerProvider(provider: KYCProvider): Register a custom KYC provider
  • getProvider(name: string): Get a registered provider
  • createVerification(userId: string, providerName: string, userData): Create verification with provider
  • syncVerificationResult(providerName: string, sessionId: string): Sync provider result to KYC entities
  • handleProviderWebhook(providerName: string, payload: unknown): Handle webhook from provider

External Provider Integration

The module supports integration with external KYC providers (AIPRISE, JUMIO, ONFIDO, etc.) through a provider interface.

Using Default Providers

import { KYCModule, KYCProviderService } from '@venturialstd/kyc';

@Module({
  imports: [KYCModule.forRoot()], // AIPRISE provider registered by default
})
export class AppModule {}

Using Custom Providers

import { Injectable } from '@nestjs/common';
import {
  KYCModule,
  KYCProvider,
  ProviderDocumentData,
  ProviderUserData,
} from '@venturialstd/kyc';

@Injectable()
class MyCustomProvider implements KYCProvider {
  readonly name = 'MY_PROVIDER';
  
  async createVerificationSession(userId: string, userData: ProviderUserData) {
    // Your implementation
  }
  
  async getVerificationStatus(sessionId: string) {
    // Your implementation
  }
  
  async handleWebhook(payload: unknown) {
    // Your implementation
  }
  
  async uploadDocument(sessionId: string, documentData: ProviderDocumentData) {
    // Your implementation
  }
}

@Module({
  imports: [
    KYCModule.forRoot({
      providers: [MyCustomProvider], // Pass the class, not an instance
      registerDefaultProviders: false, // Disable default providers
    }),
  ],
})
export class AppModule {}

Creating Verification with Provider

import { Injectable } from '@nestjs/common';
import { KYCProviderService } from '@venturialstd/kyc';

@Injectable()
export class VerificationService {
  constructor(private readonly kycProviderService: KYCProviderService) {}

  async startKYCVerification(userId: string) {
    const session = await this.kycProviderService.createVerification(
      userId,
      'AIPRISE', // Provider name
      {
        firstName: 'John',
        lastName: 'Doe',
        email: '[email protected]',
      },
    );

    // Redirect user to session.redirectUrl or embed session.widgetConfig
    return session;
  }

  async handleWebhook(providerName: string, payload: unknown) {
    return this.kycProviderService.handleProviderWebhook(providerName, payload);
  }
}

Webhook Endpoint Example

import { Controller, Post, Body, Param } from '@nestjs/common';
import { KYCProviderService } from '@venturialstd/kyc';

@Controller('webhooks/kyc')
export class KYCWebhookController {
  constructor(private readonly kycProviderService: KYCProviderService) {}

  @Post(':provider')
  async handleWebhook(
    @Param('provider') provider: string,
    @Body() payload: unknown,
  ) {
    return this.kycProviderService.handleProviderWebhook(provider, payload);
  }
}

DTOs

CreateKYCProfileDto

DTO for creating a new KYC profile.

UpdateKYCProfileDto

DTO for updating an existing KYC profile (extends PartialType of CreateKYCProfileDto).

License

MIT