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

1id

v0.4.1

Published

Hardware-anchored identity SDK for AI agents -- 1id.com

Readme

1id

Hardware-anchored identity SDK for AI agents — 1id.com

npm version License: Apache 2.0

What is 1id.com?

An identity registrar for AI agents. Like a passport office, but for software.

  • TPM-backed: Agents with a Trusted Platform Module get cryptographic proof of identity
  • Sybil-resistant: One chip = one identity. No farming.
  • Standards-based: OAuth2, OIDC, JWT — your existing libraries work
  • Free: Enrollment and authentication cost nothing

Installation

npm install 1id

Requires Node.js 18 or later. Zero runtime dependencies.

Quick Start

import oneid from "1id";

// Enroll at declared tier (no TPM required, always works)
const identity = await oneid.enroll({ request_tier: "declared" });
console.log(`Enrolled as ${identity.handle}`);

// Get an OAuth2 token for authentication
const token = await oneid.getToken();
console.log(`Bearer ${token.access_token}`);

// Check current identity
const me = oneid.whoami();
console.log(`I am ${me.handle} (tier: ${me.trust_tier})`);

Trust Tiers

| Tier | Hardware | Sybil Resistant | Trust Level | |------|----------|-----------------|-------------| | sovereign | TPM (Intel, AMD, Infineon) with valid cert | Yes | Highest | | sovereign-portable | YubiKey / Nitrokey / Feitian with attestation | Yes | Highest | | legacy | Hardware TPM or security key with expired cert | Yes | High | | virtual | VMware / Hyper-V / QEMU vTPM | No | Verified Hardware | | enclave | Apple Secure Enclave (TOFU) | No | Verified Hardware | | declared | None (software keys) | No | Software |

CRITICAL: request_tier is a REQUIREMENT, not a preference. You get exactly what you ask for, or an exception. No silent fallbacks.

API

oneid.enroll(options)

Enroll this agent with 1id.com.

const identity = await oneid.enroll({
  request_tier: "declared",           // REQUIRED: trust tier
  key_algorithm: "ed25519",           // Optional: ed25519 (default), ecdsa-p256, rsa-2048, etc.
  requested_handle: "my-agent",       // Optional: vanity handle (without @)
  operator_email: "[email protected]" // Optional: human contact
});

oneid.getToken()

Get a valid OAuth2 access token (cached, auto-refreshes).

const token = await oneid.getToken();
// Use token.access_token as a Bearer token

oneid.whoami()

Read the local identity (no network call).

const me = oneid.whoami();
// me.internal_id, me.handle, me.trust_tier, etc.

oneid.credentials_exist()

Check if the agent has enrolled.

if (!oneid.credentials_exist()) {
  await oneid.enroll({ request_tier: "declared" });
}

Error Handling

All errors extend OneIDError:

import { OneIDError, NoHSMError, EnrollmentError, NetworkError } from "1id";

try {
  await oneid.enroll({ request_tier: "sovereign" });
} catch (e) {
  if (e instanceof NoHSMError) {
    console.log("No TPM found — try 'declared' tier");
  } else if (e instanceof NetworkError) {
    console.log("Server unreachable — check connection");
  }
}

Architecture

The SDK uses a two-tier architecture:

  1. TypeScript SDK (this package) — handles enrollment orchestration, credential storage, OAuth2 token management, and software key operations using Node.js built-in crypto
  2. Go binary (oneid-enroll) — handles all TPM/HSM hardware operations. Auto-downloaded from GitHub releases when needed

For declared tier enrollment, only the TypeScript SDK is needed. For sovereign (TPM) tier, the Go binary is automatically fetched.

Credential Storage

Credentials are stored at:

  • Windows: %APPDATA%\oneid\credentials.json
  • Linux/macOS: ~/.config/oneid/credentials.json

Permissions are set to owner-only (0600 on Unix).

Python SDK

The Python equivalent is available as oneid on PyPI:

pip install oneid

Both SDKs share the same API design and credential format.

License

Apache 2.0 — see LICENSE.

Links