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

@nuggetslife/langchain

v0.1.0

Published

Nuggets identity verification toolkit for LangChain.js

Readme

@nuggetslife/langchain

Nuggets identity verification toolkit for LangChain.js — KYC, KYA, selective disclosure, and OAuth tools with full type safety and LLM-optimized descriptions.

Installation

npm install @nuggetslife/langchain @langchain/core

Quick Start

import { NuggetsToolkit } from "@nuggetslife/langchain";

const toolkit = new NuggetsToolkit({
  apiUrl: "https://api.nuggets.life",
  partnerId: "your-partner-id",
  partnerSecret: "your-secret",
});

const tools = toolkit.getTools();
// → 11 LangChain tools ready for any agent

Or configure via environment variables:

export NUGGETS_API_URL=https://api.nuggets.life
export NUGGETS_PARTNER_ID=your-partner-id
export NUGGETS_PARTNER_SECRET=your-secret
const toolkit = new NuggetsToolkit();
const tools = toolkit.getTools();

Tools

KYC (Know Your Customer)

| Tool | Description | |------|-------------| | initiate_kyc_verification | Start identity verification (returns deeplink/QR) | | check_kyc_status | Check verification completion status | | verify_age | Selective disclosure — prove minimum age without revealing DOB | | verify_credential | Verify a specific credential with selective disclosure |

KYA (Know Your Agent)

| Tool | Description | |------|-------------| | register_agent_identity | Register AI agent identity with provenance signals | | verify_agent_identity | Verify another agent's identity | | get_agent_trust_score | Get trust score and provenance signals (0–1) |

Credential & Auth

| Tool | Description | |------|-------------| | request_credential_presentation | Ask user to present verifiable credentials | | verify_presentation | Cryptographically verify presented credentials | | initiate_oauth_flow | Start OAuth/OIDC flow with Nuggets as IdP | | check_auth_status | Check user authentication and verification status |

Usage with an Agent

import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createOpenAIToolsAgent } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";
import { NuggetsToolkit } from "@nuggetslife/langchain";

const toolkit = new NuggetsToolkit();
const tools = toolkit.getTools();
const llm = new ChatOpenAI({ model: "gpt-4o" });

const prompt = ChatPromptTemplate.fromMessages([
  ["system", "You are an identity verification assistant powered by Nuggets."],
  ["human", "{input}"],
  ["placeholder", "{agent_scratchpad}"],
]);

const agent = await createOpenAIToolsAgent({ llm, tools, prompt });
const executor = new AgentExecutor({ agent, tools });

const result = await executor.invoke({
  input: "Verify my identity. My email is [email protected].",
});

Configuration

| Variable | Description | |----------|-------------| | NUGGETS_API_URL | Nuggets API endpoint | | NUGGETS_PARTNER_ID | Partner ID from Nuggets portal | | NUGGETS_PARTNER_SECRET | Partner secret key |

Self-Hosted Deployment

Point the configuration to your own Nuggets instance:

const toolkit = new NuggetsToolkit({
  apiUrl: "https://nuggets.internal.example.com/api",
  partnerId: "your-partner-id",
  partnerSecret: "your-secret",
});

Custom CA Certificates

For self-hosted instances using a private CA, use Node.js's built-in mechanism:

NODE_EXTRA_CA_CERTS=/etc/ssl/private-ca/nuggets-ca.pem node your-agent.js

License

MIT