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

keepsake-verifier-sdk

v0.1.7

Published

Verifier SDK and CLI for KeepSake: A Tokenized KYC Framework

Readme

KeepSake: Tokenized KYC Verifier SDK

This package is the official Verifier SDK for the KeepSake framework. It provides both a Node.js library and a powerful CLI to verify the authenticity and validity of a Tokenized KYC Credential (VC-JWT).

It works by checking a token's signature against the public key of its Issuer, which is retrieved from the decentralized Trust Layer. It embarks on the KeepSake infrastructure.

The Big Picture (Verification Flow)

+------------------+     +--------------------------+     +---------------------+
|                  |     |                          |     |                     |
|  Verifier's App  |     |   [KYC Verifier SDK]     |     |       Trust Layer   |
| (e.g. Mutual Fund)|     | (This Package)           |     | (Deployed on Render)|
|                  |     |                          |     |                     |
+------------------+     +--------------------------+     +---------------------+
         |                           |                           |
         |  1. User presents token   |                           |
         |-------------------------->|                           |
         |                           |  2. Check if revoked?     |
         |                           |-------------------------->|
         |                           |                           |  3. Return status
         |                           |<--------------------------|
         |                           |                           |
         |                           |  4. Get Issuer public key |
         |                           |-------------------------->|
         |                           |                           |  5. Return key
         |                           |<--------------------------|
         |                           |                           |
         |                           |  6. Verify signature (local)
         |                           |                           |
         |  7. Return "VERIFIED"     |                           |
         |<--------------------------|                           |
         |                           |                           |

Features

  • Programmatic SDK: A simple KycVerifier class for use in your Node.js backend.
  • Powerful CLI: Verify tokens or run a full demo right from your terminal.
  • Strongly Typed: Full TypeScript support for all methods and objects.
  • Trust Agnostic: Connects to any compatible Trust Layer (currently our keepsake-mock-trust-layer.onrender.com prototype).

Installation

npm install keepsake-verifier-sdk

User Guide: Programmatic (SDK)

Use the KycVerifier class in your backend service to verify tokens received from a user.

import { KycVerifier, VerificationResult } from 'keepsake-verifier-sdk';

// 1. Initialize the verifier with the URL of the Trust Layer
const verifier = new KycVerifier({
  trustLayerUrl: 'https://keepsake-mock-trust-layer.onrender.com'
});

// 2. Get the token from the user (e.g., in an API request)
const userToken = "eyJhbGciOiJFUzI1...IiwicGFuIjoiQUJDR...XJw";

// 3. Verify the token
async function verifyUser() {
  const result: VerificationResult = await verifier.verifyVcJwt(userToken);

  if (result.isValid) {
    console.log("✅ Verification Successful!");
    // The trusted, verified data is in the payload
    const kycData = result.payload.vc.credentialSubject;
    console.log("User's PAN:", kycData.pan);
    console.log("User's Name:", kycData.nameAsPerPan);
  } else {
    console.error("❌ Verification Failed:", result.error);
    // e.g., "Token is expired" or "Credential has been revoked"
  }
}

verifyUser();

User Guide: Command Line (CLI)

This package provides the kyc-verify command.

1. verify command

Verify a specific token string.

# You must pass the token string as an argument
npx keepsake-verifier-sdk verify "eyJhbGciOiJFUzI1...IiwicGFuIjoiQUJDR...XJw"

# You can optionally specify a different Trust Layer
npx keepsake-verifier-sdk verify <token> --trust-layer "http://localhost:3001"

Success Output:

$ npx keepsake-verifier-sdk verify ...
Verifying token using Trust Layer at: https://keepsake-mock-trust-layer.onrender.com...

✅ VERIFICATION SUCCESSFUL
-----------------------------
{
  "id": "did:example:cli-demo-user",
  "type": "PanVerification",
  "pan": "ABCDE1234F",
  "nameAsPerPan": "Rohan Kumar",
  "verificationSource": "InternalBankDB-NSDL-Simulated"
}

Failure Output:

$ npx keepsake-verifier-sdk verify ...
Verifying token using Trust Layer at: https://keepsake-mock-trust-layer.onrender.com...

❌ VERIFICATION FAILED
-------------------------
Credential has been revoked

2. demo command

This is the best way to test the live system. It runs a full, end-to-end loop:

  1. Calls the Issuer Service to mint a new PAN token.
  2. Takes that new token and immediately sends it to the Trust Layer for verification.
# Just run 'demo' to test the deployed cloud services
npx keepsake-verifier-sdk demo

# You can also point it at your local services
npx keepsake-verifier-sdk demo \
  --issuer-url "http://localhost:3002" \
  --trust-layer "http://localhost:3001"

Demo Output:

$ npx keepsake-verifier-sdk demo
🚀 Starting KYC End-to-End Demo...

[1/3] Ensuring Issuer is registered at: https://keepsake-issuer-service.onrender.com...
Issuer is already registered. Proceeding.

[2/3] Minting a new PAN token from: https://keepsake-issuer-service.onrender.com...
Successfully minted new token!
Token: eyJhbGciOiJFUzI1NiIsInR5cCI6In...

[3/3] Verifying the new token against: https://keepsake-mock-trust-layer.onrender.com...
Verifying token using Trust Layer at: https://keepsake-mock-trust-layer.onrender.com...

✅ VERIFICATION SUCCESSFUL
-----------------------------
{
  "id": "did:example:cli-demo-user",
  "type": "PanVerification",
  "pan": "ABCDE1234F",
  "nameAsPerPan": "Rohan Kumar",
  "verificationSource": "InternalBankDB-NSDL-Simulated"
}

Future Scope

This prototype is the foundation for a full production system. Future improvements will include:

  • NBF Integration: Replacing the Mock Trust Layer with a client for India's National Blockchain Framework (NBF).
  • ZKP Support: Adding methods to verify Zero-Knowledge Proofs (e.g., verifyAgeProof()) for privacy-preserving verification.
  • Schema Validation: The SDK will automatically validate the credentialSubject against the official JSON schemas.
  • Advanced Caching: A local caching layer for Issuer public keys to reduce latency.

License

MIT License - see LICENSE file for details.

Contributing

write email to [email protected]