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

@anankai/kyc-sdk

v1.0.11

Published

KYC SDK - User details, questionnaire, and document upload flow with feature flagging

Readme

@anankai/kyc-sdk

A React SDK for the KYC (Know Your Customer) verification flow. Uses the same UI, components, and API flow as the main app: Material UI, axios, multi-step flows, and backend integration.

Flow Overview

| Step | Description | |------|-------------| | 1. User Details | Full form (Settings): name, address, DOB, phone, gender, occupation, etc. Updates profile + negative screening API | | 2. KYC Questionnaire | Screening questions from API; dynamic types (text, radio, select, etc.); saves answers to backend | | 3. Document Upload | Proof of ID and Proof of Address with stepper: select type → upload front/back → details → review |

Installation

npm install @anankai/kyc-sdk
# or
yarn add @anankai/kyc-sdk
# or
pnpm add @anankai/kyc-sdk

Peer dependencies: React 17+


Quick Start – Full Flow (Production UI)

Use KYCFullFlow for the full production-style flow. No extra providers required — the SDK includes its own i18n, MUI theme, and styling:

import { KYCFullFlow } from '@anankai/kyc-sdk';

function KYCPage() {
  return (
    <KYCFullFlow
      config={{
        baseUrl: 'https://your-api.com',
        loginData: {
          access_token: 'your-jwt-token',
          user_id: 1,
          entity_id: 1,
          username: 'user',
          current_profile: 'wallet_user',
          user_state: 'kyc upload pending',
          selfregistered: true,
          owner_company: 1,
          programme_manager: 0,
          subprogramme_manager: 0,
          corporate: 0,
        },
        userProfile: {
          first_name: '',
          last_name: '',
          address_1: '',
          city: '',
          state: '',
          zip_code: '',
          country: 'United Kingdom',
          phone_number: '',
          birthdate: '',
          email: '',
          gender: 'Unknown',
        },
        onComplete: () => console.log('KYC completed'),
      }}
    />
  );
}

Asset setup (document upload icons)

For the document selection screen to show passport and utility bill icons, add these to your app's public/img/icons/:

  • passport-icon.png
  • utility-bill-icon.png

KYCFullFlow Config

| Prop | Type | Required | Description | |------|------|----------|-------------| | baseUrl | string | Yes | API base URL (e.g. https://api.example.com) | | loginData | object | Yes | Auth + user context: access_token, user_id, entity_id, username, current_profile, user_state, etc. | | userProfile | object | Yes | Pre-filled or empty profile: first_name, last_name, address_1, city, state, zip_code, country, phone_number, birthdate, email, gender | | onComplete | () => void | No | Called when user completes the full KYC flow | | onStepChange | (screen, index) => void | No | Called when navigating between screens | | onError | (error) => void | No | Called on API or validation errors |


Simplified Flow (KYCJourney)

For a simpler, customizable flow with feature flags:

import { KYCJourney } from '@anankai/kyc-sdk';

<KYCJourney
  config={{
    featureFlags: {
      steps: {
        questionnaire: { enabled: false },  // Skip questionnaire
      },
    },
    onComplete: () => {},
  }}
/>

Feature Flags (KYCJourney)

| Step | Option | Default | Description | |------|--------|---------|-------------| | userDetails | enabled | true | Show user details step | | questionnaire | enabled | true | Show questionnaire step | | questionnaire | skipWhenEmpty | true | Skip questionnaire if there are no questions | | documentUpload | enabled | true | Show document upload step |

| Feature | Description | |---------|-------------| | proofOfId | Allow Proof of ID document uploads | | proofOfAddress | Allow Proof of Address document uploads | | documentReview | Show document review step before submission |


Customization (KYCJourney)

Custom User Details

<KYCJourney
  config={{ onComplete: () => {} }}
  renderUserDetails={({ onSubmit, onBack }) => (
    <YourCustomForm onSubmit={onSubmit} onBack={onBack} />
  )}
/>

Questionnaire – Static or API

// Static questions
<KYCJourney
  config={{ onComplete: () => {} }}
  questionnaireQuestions={[
    { id: 'q1', question: 'Occupation?', type: 'text', required: true },
  ]}
/>

// Fetch from API
<KYCJourney
  config={{ onComplete: () => {} }}
  fetchQuestionnaire={async () => {
    const res = await fetch('/api/kyc/questions');
    const data = await res.json();
    return data.questions;
  }}
/>

Exports

import {
  KYCFullFlow,      // Full production flow
  KYCJourney,       // Simplified flow with feature flags
  UserDetailsStep,
  QuestionnaireStep,
  DocumentUploadStep,
  useFeatureFlags,
  loadFeatureFlags,
} from '@anankai/kyc-sdk';

import type {
  KYCSDKConfig,
  FeatureFlagsConfig,
  UserDetailsData,
  QuestionnaireQuestion,
  DocumentUploadData,
} from '@anankai/kyc-sdk';

API Calls & Endpoints

The SDK uses the same KYC flow as the main app (not SumSub). All API calls use your baseUrl and loginData.access_token from config.

| Step | Endpoints | |------|-----------| | User Details | POST update-user-profile, POST rt-main-user-kyc (negative screening) | | Questionnaire | GET get-entity-screening-questions, POST insert-users-screening-questions | | Document Upload | GET get-kyc-docs-needed-uploaded-by-user, GET get-acceptable-kyc-document-by-user, POST get-customer-file-pre-signed-url / get-staff-file-pre-signed-url, POST insert-kyc-document-status |

Request handlers (universalGetRequestWithParams, universalPostRequestWithData) add the Bearer token and lang automatically. See API_REFERENCE.md for full details.


Package Structure

@anankai/kyc-sdk
├── API_REFERENCE.md    # Full API docs (endpoints, flow, request handlers)
├── config/
│   ├── feature-flags.json
│   └── feature-flags.schema.json
└── dist/              # Built output (JS, CSS, types)

Publishing (Maintainers)

  1. Replace YOUR_NPM_ACCESS_TOKEN in .npmrc with your npm token.

  2. Run:

    npm run publish:public

License

MIT