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

@agents-space/client

v0.1.0

Published

Agent SDK for agentids.space — fetch ID Tokens, sign DPoP proofs, and call any agentids-aware service. Works in Node 22+ and modern browsers.

Readme

@agents-space/client

Agent SDK for agentids.space. Sign requests with a private_key_jwt client assertion to obtain an ID Token, then attach DPoP-bound proofs to every Relying Party call.

Install

pnpm add @agents-space/client

Works in Node 22+ and modern browsers (uses Web Crypto only — no node:* imports).

Confidential agent (server-side)

import { AgentClient } from "@agents-space/client";

const client = new AgentClient({
  agentId: process.env.AGENTIDS_AGENT_ID!,
  privateKey: process.env.AGENTIDS_PRIVATE_KEY_PEM!,
  issuer: "https://agentids.space",
});

const res = await client.fetch("https://rp.example.com/api/comment", {
  method: "POST",
  audience: "rp.example.com",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ text: "hi" }),
});

The SDK:

  • mints an ID Token (cached per audience for ~10 min, refreshed ~60s before expiry)
  • builds a fresh DPoP proof bound to (method, URL, sha256(id_token)) for each request
  • attaches Authorization: AgentIDs <token> and DPoP: <proof>

Device agent (on-device)

For browser extensions, desktop apps, mobile clients — anywhere the agent runs on a user's machine.

const result = await AgentClient.bootstrap({
  issuer: "https://agentids.space",
  agentName: "My Browser Helper",
  deviceLabel: "Hoang's MacBook",
  onUserCode: ({ userCode, verificationUriComplete }) => {
    window.open(verificationUriComplete, "_blank");
    showInUI(`Code: ${userCode}`);
  },
});

const client = new AgentClient({
  agentId: result.agentId,
  privateKey: result.privateKey,    // CryptoKey, generated locally
  publicJwk: result.publicJwk,      // required when passing CryptoKey
  issuer: "https://agentids.space",
});

The keypair is generated on-device with crypto.subtle.generateKey({name:"ECDSA", namedCurve:"P-256"}). Only the public key reaches the server.

Persisting on-device keys

The returned privateKey is a CryptoKey — extractable by default so you can store it however you like.

// IndexedDB (browser)
import { openDB } from "idb";
const db = await openDB("agentids", 1, { upgrade: (d) => d.createObjectStore("k") });
await db.put("k", { agentId, privateKey, publicJwk }, "current");

// PEM file (Node)
const pkcs8 = await crypto.subtle.exportKey("pkcs8", result.privateKey);
const pem = `-----BEGIN PRIVATE KEY-----\n${Buffer.from(pkcs8).toString("base64").match(/.{1,64}/g).join("\n")}\n-----END PRIVATE KEY-----\n`;
fs.writeFileSync(path, pem, { mode: 0o600 });

Token lifecycle

  • Cache key: audience (different RPs get different tokens).
  • TTL: 10 minutes.
  • Refresh threshold: 60s before expiry.
  • Concurrent calls dedupe — no thundering herd at /token.

See also