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

@primethoughts/credence-sdk

v1.0.0-rc.1

Published

TypeScript SDK for Credence Trust OS — typed client for 82+ gateway endpoints covering W3C VCs, OID4VCI/OID4VP, DIDComm, Trust Registry, and DPP lifecycle

Downloads

15

Readme

@primethoughts/credence-sdk

TypeScript SDK for Credence Trust OS. Wraps all 82 gateway REST endpoints across 8 service modules.

Installation

npm install @primethoughts/credence-sdk

Requires Node.js >= 20.0.0.

Quick Start

import { CredenceClient } from '@primethoughts/credence-sdk';

// Register a new supplier (public — no JWT required)
const credence = new CredenceClient({
  baseUrl: 'https://gateway.credence.example:8080',
});

const auth = await credence.identity.register({
  name: 'Jane Doe',
  email: '[email protected]',
  password: 'Secret123!',
  role: 'SUPPLIER',
});
credence.setToken(auth.token); // all subsequent calls authenticated

// Or login with existing credentials
const loginAuth = await credence.identity.login({
  email: '[email protected]',
  password: 'Secret123!',
});
credence.setToken(loginAuth.token);

// Identity — tenant management
const tenant = await credence.identity.createTenant({ name: 'Acme Corp' });
const tenants = await credence.identity.listTenants();

// Messaging — accept an invitation from DIA authority
const connection = await credence.messaging.acceptInvitation({
  invitationUrl: 'https://agent.example.com?oob=eyJhbGciOiJFZERTQSJ9',
  alias: 'dia-authority',
});

// Credentials
const credential = await credence.credentials.issue({ schemaId, subjectDid, claims });
const result = await credence.credentials.verifyV2({ presentationId, policyId });

// Registry (TRQP read)
const frameworks = await credence.registry.listFrameworks();

// Registry (admin write)
const framework = await credence.registry.admin.createFramework({ did, name, version });

// VDR
const schema = await credence.vdr.writeSchema({ name, version, attributes });

Modules

| Module | Description | Endpoint Prefix | |--------|------------|----------------| | identity | Auth (register, login, password reset, refresh), tenants, DIDs, wallets | /api/v1/auth/**, /api/v1/tenants/** | | messaging | Connections, create/accept invitations | /api/v1/connections/** | | credentials | Issue, verify, revoke | /api/v1/credentials/** | | presentations | Presentation exchange, OID4VP | /api/v1/presentations/** | | registry | TRQP queries + admin write | /api/v1/registry/**, /api/v1/admin/** | | compliance | Checks, audit events, rules | /api/v1/compliance/** | | evidence | Upload, verify, link | /api/v1/evidence/** | | vdr | Schemas, cred-defs, NYMs, revocation | /api/vdr/** |

Features

  • Zero runtime dependencies — uses only Node.js builtins (node:crypto)
  • Dual ESM + CJS build — works in all Node.js environments
  • Full TypeScript types — mirrored from Credence backend DTOs
  • Auto correlation IDX-Correlation-ID header on every request
  • Retry with backoff — configurable retry for 429/502/503/504
  • RFC 7807 errors — structured error responses with CredenceApiError
  • DID validation — client-side allowlist check (did:key, did:peer, did:indy, did:web)
  • Key material detection — prevents accidental secret leakage

Configuration

const credence = new CredenceClient({
  baseUrl: 'https://gateway:8080',
  auth: { type: 'jwt', token: 'eyJ...' },
  retry: { maxRetries: 3, baseDelay: 1000, maxDelay: 30000 },
  timeout: 30000,
  correlationId: 'custom-correlation-id', // optional; auto-generated if omitted
});

// Refresh token
credence.setToken(newToken);

// Add interceptors
credence.addRequestInterceptor(async (url, init) => {
  // modify request before sending
  return init;
});

Breaking Changes (v0.2.0)

Governance VC lifecycle methods now require LifecycleTransitionRequest

All 5 governance VC lifecycle methods (submitForReview, activateGovernanceVc, suspendGovernanceVc, reinstateGovernanceVc, revokeGovernanceVc) now require a LifecycleTransitionRequest body with a mandatory actorDid field:

// Before (v0.1.x) — no longer works
await credence.registry.admin.submitForReview(vcId);

// After (v0.2.0) — actorDid is required
await credence.registry.admin.submitForReview(vcId, {
  actorDid: 'did:web:steward.example.com',
  reason: 'Ready for governance board review', // optional
});

GovernanceVcCreateRequest now requires proofHash

The proofHash field (SHA-256 hash of canonical VC JSON) is now required when creating governance VCs for deduplication:

await credence.registry.admin.createGovernanceVc({
  frameworkId: '...',
  vcType: 'ISSUER_AUTHORIZATION',
  vcJson: { /* W3C VCDM 2.0 */ },
  issuerDid: 'did:web:authority.example.com',
  subjectDid: 'did:web:issuer.example.com',
  validFrom: '2026-01-01T00:00:00Z',
  proofHash: 'sha256-hex-hash-of-canonical-vc-json', // now required
});

Framework request field renames

TrustFrameworkCreateRequest and TrustFrameworkUpdateRequest use did (not governingAuthority) and metadata (not description):

await credence.registry.admin.createFramework({
  did: 'did:web:authority.example.com',  // was: governingAuthority
  name: 'My Framework',
  version: '1.0.0',
  metadata: { description: '...' },       // was: description (string)
});

Development

npm install          # Install dependencies
npm run build        # Build ESM + CJS + DTS
npm test             # Run 152 unit tests
npm run typecheck    # TypeScript type checking

Spec & Compliance

  • Spec: specs/credence-sdk/spec.md (85 FRs, 8 NFRs)
  • Compliance audit: specs/credence-sdk/compliance-audit.md — all PASS
  • KB references: [KB:00-system], [KB:01-architecture], [KB:14-learnings-v1-v2]