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

snapkyc-qrcode

v0.1.1

Published

Of course. Here is a comprehensive and professional README file for your SDK. You can copy and paste this directly into a `README.md` file in the root of your project.

Readme

Of course. Here is a comprehensive and professional README file for your SDK. You can copy and paste this directly into a README.md file in the root of your project.


SnapKYC Aadhaar QR SDK

A lightweight and easy-to-use React component library for integrating Aadhaar QR code verification into your web application. This SDK provides a simple modal component that handles QR code generation, status polling, and returns verified user data.

It's built with TypeScript, ensuring full type safety for a seamless development experience. 🚀

Features

  • Simple Integration: Add Aadhaar verification to your app with just one component.
  • Automatic Flow: Handles QR code generation and server polling for verification status automatically.
  • Clean UI: Provides a clean, responsive modal (QRModal) that works on all screen sizes.
  • Type-Safe: Fully written in TypeScript, providing excellent autocompletion and type checking.
  • Lightweight: Minimal dependencies to keep your application's bundle size small.

Installation

You can install the package using npm or yarn.

npm install snapkyc-qrcode

or

yarn add snapkyc-qrcode

Usage

Here's a basic example of how to use the QRModal component in your React application.

import React, { useState } from 'react';
// 1. Import the component and its types from the SDK
import { QRModal, VerifiedData } from 'snapkyc-qrcode';

function MyProfilePage() {
  // 2. State to control the modal's visibility
  const [isModalOpen, setIsModalOpen] = useState(false);

  // 3. State to store the verified user data
  const [aadhaarData, setAadhaarData] = useState<VerifiedData | null>(null);

  // 4. Callback function to handle the successful verification
  const handleVerificationSuccess = (data: VerifiedData) => {
    console.log("Verification Successful!", data);
    setAadhaarData(data);
    // You can now use the data to fill a form, update your backend, etc.
  };

  return (
    <div>
      <h1>My Profile Verification</h1>

      {aadhaarData ? (
        <div>
          <h2>✅ Verification Complete!</h2>
          <p><strong>Name:</strong> {aadhaarData.name}</p>
          <p><strong>Date of Birth:</strong> {aadhaarData.dateOfBirth}</p>
          {aadhaarData.image && 
            <img 
              src={aadhaarData.image} 
              alt="Aadhaar Photograph" 
              style={{ width: '150px', borderRadius: '8px' }} 
            />
          }
        </div>
      ) : (
        <button onClick={() => setIsModalOpen(true)}>
          Verify with Aadhaar
        </button>
      )}

      {/* 5. Add the QRModal to your component */}
      <QRModal
        isOpen={isModalOpen}
        onClose={() => setIsModalOpen(false)}
        onVerificationSuccess={handleVerificationSuccess}
      />
    </div>
  );
}

export default MyProfilePage;

Component API

<QRModal />

This is the main component you will use. It displays the modal window for the QR code verification process.

| Prop | Type | Required | Description | | ----------------------- | ----------------------------------- | -------- | -------------------------------------------------------------------------- | | isOpen | boolean | Yes | Controls whether the modal is visible or not. | | onClose | () => void | Yes | Function called when the user closes the modal (e.g., by clicking the 'X'). | | onVerificationSuccess | (verifiedData: VerifiedData) => void | Yes | Callback function that receives the user data upon successful verification. |


Data Structure

VerifiedData

The onVerificationSuccess callback returns an object with the following structure. All fields are optional and will be present based on the data shared by the user.

interface VerifiedData {
  name?: string;
  mobile?: string;
  email?: string;
  address?: string;
  // The image is a Base64 encoded data URL string
  image?: string; 
  dateOfBirth?: string;
  aadhaarNumber?: string;
  // Any other disclosed fields will be added here
  [key: string]: string | boolean | undefined;
}

License

Distributed under the MIT License. See LICENSE file for more information.