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

@credat/sdk

v0.3.0-alpha.1

Published

Trust layer for AI agents — delegation, verification, and mutual trust using DIDs and Verifiable Credentials

Downloads

125

Readme

npm CI License: Apache-2.0 TypeScript Node.js


Your AI agent just mass-emailed 200 contacts, booked $12,000 in flights, and approved three vendor contracts. You never authorized any of it.

Agents are multiplying. Authorization hasn't kept up. Credat fixes that.

An owner issues scoped credentials to an agent. A service verifies the agent's identity and permissions before acting. Three messages. Cryptographic proof. Done.

~28KB bundled · 2 dependencies · 174 tests · Zero config · Node.js 22+

Quick Start

npm install @credat/sdk
import {
  generateKeyPair, createDidWeb, createAgent, delegate,
  createChallenge, presentCredentials, verifyPresentation, hasScope
} from '@credat/sdk'

// Owner identity
const ownerKeyPair = generateKeyPair('ES256')
const ownerDid = createDidWeb('alice.example.com')

// Create an agent
const agent = await createAgent({ domain: 'agents.alice.example.com', path: 'assistant' })

// Delegate scoped permissions
const delegation = await delegate({
  agent: agent.did,
  owner: ownerDid,
  ownerKeyPair,
  scopes: ['email:read', 'calendar:write', 'travel:book'],
  constraints: { maxTransactionValue: 1000 },
  validUntil: new Date(Date.now() + 86_400_000).toISOString(),
})

// Service challenges the agent → Agent presents proof → Service verifies
const challenge = createChallenge({ from: 'did:web:airline.example.com' })
const presentation = await presentCredentials({ challenge, delegation: delegation.token, agent })
const result = await verifyPresentation(presentation, {
  challenge,
  ownerPublicKey: ownerKeyPair.publicKey,
  agentPublicKey: agent.keyPair.publicKey,
})

result.valid                    // true
result.scopes                   // ['email:read', 'calendar:write', 'travel:book']
hasScope(result, 'travel:book') // true

The agent proved who it is. The service knows what it can do.

How It Works

An owner delegates permissions to an agent as a signed credential. When a service needs to trust the agent, they run a three-message handshake: challenge, presentation, verification.

┌─────────┐                        ┌─────────────┐
│  Owner  │                        │   Service   │
│ (Alice) │                        │ (Airline)   │
└────┬────┘                        └──────┬──────┘
     │                                    │
     │  1. delegate(scopes, constraints)  │
     │ ──────────────────┐                │
     ▼                   │                │
┌─────────┐              │                │
│  Agent  │◄─────────────┘                │
│ (Alice's│                               │
│  Asst.) │   2. challenge (nonce)        │
│         │◄──────────────────────────────│
│         │                               │
│         │   3. presentation (proof+VC)  │
│         │──────────────────────────────►│
│         │                               │
│         │   4. verified ✓ (scopes)      │
│         │◄──────────────────────────────│
└─────────┘                        └──────┘

Delegation — Owner signs an SD-JWT VC encoding scopes and constraints. Challenge — Service sends a random nonce to the agent. Presentation — Agent signs the nonce and presents the delegation credential. Verification — Service verifies nonce signature, VC signature, scopes, and expiration.

Features

| Feature | Description | |---------|-------------| | Agent Identity | Create agent identities with did:web and did:key, auto-generated DID Documents | | Delegation | Issue scoped delegation credentials (SD-JWT VC) with constraints and expiration | | Delegation Chains | Agent → sub-agent delegation with scope subsetting and depth limits | | Handshake | Three-message challenge / presentation / verification protocol | | Scope Helpers | hasScope, hasAnyScope, hasAllScopes, getAllScopes, validateConstraints | | Selective Disclosure | Agents reveal only the scopes needed for each interaction | | Revocation | W3C Status List 2021 for credential revocation | | Storage | Pluggable storage (in-memory default, SQLite optional) | | Crypto | ES256 (P-256) and EdDSA (Ed25519) via @noble/curves | | DIDs | did:web and did:key — create and resolve | | Type-Safe | Full TypeScript strict mode, discriminated unions, all types exported | | Dual Build | ESM + CommonJS, tree-shakeable |

Why Credat

  • 🔐 Standards-based — W3C DIDs + SD-JWT VC. Not proprietary. Your agents speak the same language as the rest of the identity ecosystem.
  • 📦 Two dependencies@noble/curves and @noble/hashes. No blockchain. No cloud service. No vendor lock-in.
  • 🦺 TypeScript-first — Strict mode, discriminated unions, every type exported. Your IDE catches bugs before you run anything.
  • 🔌 Transport-agnostic — HTTP, WebSocket, DIDComm, message queue. Credat handles trust, you handle transport.
  • 🎯 Scopes are yours — Credat stores and verifies permission strings. Your domain defines what they mean.

Think of it as the Zod of agent trust — small, typed, standards-based, does one thing well.

Use Cases

  • AI Assistants — Your agent books flights and sends emails. Credat proves to the airline API it has permission to act on your behalf.
  • Multi-Agent Systems — Agent A calls Agent B's API. The handshake lets them verify each other's identity and scopes before exchanging data.
  • Customer Service Bots — A support bot handles refunds up to $500. Delegation constraints enforce the spending limit cryptographically.
  • Agent Marketplaces — A platform hosts third-party agents, each scoped to exactly what the user authorized.

Ecosystem

| Integration | Status | |-------------|--------| | Node.js / TypeScript | ✅ Available | | MCP (Model Context Protocol) | 🔨 In Progress | | LangChain / LangGraph | 🔨 In Progress | | OpenAI Agents SDK | 📋 Planned | | Vercel AI SDK | 📋 Planned |

Want an integration? Open an issue or start a discussion.

Specifications

| Specification | Status | |---------------|--------| | SD-JWT VC (draft-14) | Implemented | | W3C Status List 2021 | Implemented | | did:web | Implemented | | did:key | Implemented | | ES256 (P-256) / EdDSA (Ed25519) | Implemented |

Contributing

Credat is young and moving fast. Contributions are welcome — whether it's a bug fix, a new integration, better docs, or just feedback.

git clone https://github.com/credat/credat.git
cd credat
npm install
npm test          # 174 tests
npm run build     # ESM + CJS + .d.ts
npm run typecheck # TypeScript strict
npm run lint      # Biome

We follow conventional commits. Check out the open issues to get started.

License

Apache 2.0 — free for commercial use.