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

@apoa/core

v0.2.4

Published

The reference implementation for the Agentic Power of Attorney standard

Readme

@apoa/core

Reference TypeScript SDK for the Agentic Power of Attorney (APOA) standard -- authorization infrastructure for AI agents.

Install

npm install @apoa/core

Quick Start

import { APOA, generateKeyPair } from '@apoa/core';

const keys = await generateKeyPair();
const apoa = new APOA({ privateKey: keys.privateKey });

const token = await apoa.tokens.createGrant({
  principal: "did:apoa:alex",
  agent: { id: "did:apoa:docs-assistant", name: "Docs Assistant" },
  service: "knowledge-base",
  scopes: ["articles:search", "articles:summarize"],
  constraints: { externalSharing: false },
  expiresIn: "24h",
});

const valid = await apoa.tokens.validate(token.raw, { publicKey: keys.publicKey });
console.log(valid.valid); // true

const result = await apoa.authorizations.check(
  token,
  "knowledge-base",
  "articles:summarize"
);
// { authorized: true, checks: { revoked: false, scopeAllowed: true, ... } }

const denied = await apoa.authorizations.check(
  token,
  "knowledge-base",
  "articles:delete"
);
// { authorized: false, reason: "scope 'articles:delete' not in authorized scopes" }

Features

  • Token lifecycle: create, sign (Ed25519/ES256), validate, parse
  • Scope matching: hierarchical patterns (articles:* matches articles:read)
  • Constraint enforcement: boolean denial checks
  • Authorization: revocation + scope + constraints + hard/soft rules in one call
  • Delegation chains: capability attenuation (permissions only narrow, never expand)
  • Cascade revocation: revoke parent, all children die instantly
  • Audit trail: append-only action log per token
  • Browser mode: credential vault injection config (the AI never sees passwords)
  • Comprehensive test suite with cross-SDK fixture verification against the Python SDK

Usage Styles

Application facade

Recommended for apps. Configure keys once, then use namespaced resources.

import { APOA } from '@apoa/core';

const apoa = new APOA({ privateKey: keys.privateKey });
const token = await apoa.tokens.createGrant({
  principal: "did:apoa:alex",
  agent: "did:apoa:docs-assistant",
  service: "knowledge-base",
  scopes: ["articles:search"],
  expiresIn: "24h",
});
await apoa.authorizations.check(token, "knowledge-base", "articles:search");

Protocol client

Use this when you want direct access to stores, resolvers, and protocol-level options.

import { createClient, MemoryAuditStore, MemoryRevocationStore } from '@apoa/core';

const client = createClient({
  revocationStore: new MemoryRevocationStore(),
  auditStore: new MemoryAuditStore(),
  defaultSigningOptions: { privateKey: keys.privateKey },
});
await client.authorize(token, "knowledge-base", "articles:search");

Standalone imports

Useful for scripts, tests, adapters, and focused protocol operations.

import { checkScope, authorize, createToken } from '@apoa/core';

checkScope(token, "knowledge-base", "articles:search");

Cross-SDK Compatibility

Tokens created by @apoa/core validate in the Python SDK and vice versa. The camelCase JWT payload round-trips correctly across both SDKs.

Ecosystem

  • @apoa/mcp -- APOA authorization for MCP servers
  • @apoa/a2a -- APOA authorization for A2A agent-to-agent communication
  • apoa -- Python SDK

Links

License

Apache-2.0