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

@clgplatform/verify

v1.5.0

Published

Standalone verifier for CLG signed decision receipts. Validates signatures and hash chains without contacting the CLG platform.

Downloads

119

Readme

@clgplatform/verify

Independent verifier for CLG signed receipts and receipt chains.

npm node license

What it is

@clgplatform/verify is a verification layer for receipts emitted by CLG-integrated runtimes. It validates receipt integrity and authenticity cryptographically.

What it verifies

  • canonical hash matches content
  • signature is valid
  • required fields are present
  • previous receipt hashes link correctly in chains

What it does not do

  • does not intercept MCP tool calls
  • does not enforce mandates
  • does not create receipts
  • does not replace runtime controls or governance processes

It can verify offline when you provide a local key or resolver. The CLI defaults to HTTP key resolution unless you pass --public-key, --jwks, or --offline. Library usage resolves keys according to the PEM string or resolver you pass to verifyReceipt or verifyChain.

Installation

npm install @clgplatform/verify

Quick start

import { verifyReceipt, fileResolver } from '@clgplatform/verify';

const result = await verifyReceipt(receipt, fileResolver('./signing-key.pem'));
console.log(result.valid);

CLI usage

# single receipt
clg-verify receipt receipt.json

# chain
clg-verify chain receipts.json

# local key file
clg-verify --public-key signing-key.pem receipt receipt.json

# JWKS-style endpoint
clg-verify --jwks https://api.clgplatform.com/.well-known/clg-keys receipt receipt.json

# force no default HTTP key lookup (requires --public-key or --jwks)
clg-verify --offline --public-key signing-key.pem receipt receipt.json

# pretty JSON output
clg-verify --pretty --public-key signing-key.pem chain receipts.json

# stdin
cat receipt.json | clg-verify --public-key signing-key.pem receipt -

Exit codes

| Code | Meaning | |---:|---| | 0 | Valid | | 1 | Invalid | | 2 | Error (network, file, parse) |

Library usage

Single receipt:

import { verifyReceipt, httpResolver } from '@clgplatform/verify';

const result = await verifyReceipt(receipt, httpResolver('https://api.clgplatform.com'));

Receipt chain:

import { verifyChain, jwksResolver } from '@clgplatform/verify';

const result = await verifyChain(receipts, jwksResolver('https://api.clgplatform.com/.well-known/clg-keys'));

JWKS Verification (v1.4.0+)

Verify receipts using the platform's RFC 7517 JWKS endpoint — no manual key exchange needed:

import { verifyReceiptWithJwks } from '@clgplatform/verify';

const result = await verifyReceiptWithJwks(receipt, {
  baseUrl: 'https://clgplatform.com',
});
console.log(result.valid); // true if hash + signature check out

This fetches /.well-known/jwks.json, finds the key matching the receipt's signing_key_id, converts JWK→PEM, and verifies. Existing verifyReceipt() is unchanged.

You can also use the lower-level functions directly:

import { fetchJwks, findKeyByKid, jwkToPem } from '@clgplatform/verify';

const jwks = await fetchJwks('https://clgplatform.com');
const jwk = findKeyByKid(jwks, receipt.signing_key_id);
const pem = jwkToPem(jwk);
// use pem with verifyReceipt or your own crypto

Resolvers

  • httpResolver(baseUrl?) → fetches {baseUrl}/v1/keys/{kid}
  • jwksResolver(url?) → fetches key set once and caches by kid
  • staticResolver(pem) → always returns the same PEM
  • fileResolver(path) → reads PEM from local file

You can also pass a PEM string directly to verifyReceipt / verifyChain.

How verification works

  1. Select canonical content fields.
  2. Canonicalize the content.
  3. Hash canonical content.
  4. Compare computed hash with receipt_hash.
  5. Verify signature with signer public key.
  6. Verify previous_receipt_hashes links for chains.

Use with @clgplatform/mcp

  • @clgplatform/mcp guards MCP tool execution and creates signed receipts.
  • @clgplatform/verify verifies those receipts afterward.

Status

Beta.

License

BUSL-1.1. See LICENSE.