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

@pramanasystems/sdk-client

v1.0.19

Published

Type-safe SDK client for the PramanaSystems Runtime API.

Readme

@pramanasystems/sdk-client

Type-safe fetch client for the PramanaSystems governance server.

npm


Overview

@pramanasystems/sdk-client is a zero-dependency TypeScript client for @pramanasystems/server. Types are generated directly from openapi.json using openapi-typescript, so the client types are always in sync with the server API.

  • Zero runtime dependencies — native fetch only
  • Fully typed — all request bodies, responses, and error types are inferred from the OpenAPI spec
  • Throws on non-2xx — errors surface as PramanaApiError with the HTTP status code attached

Installation

npm install @pramanasystems/sdk-client

Requires Node.js ≥ 20 (for native fetch) or any environment with a global fetch implementation.


Quick start

import { PramanaClient } from "@pramanasystems/sdk-client";

const client = new PramanaClient({
  baseUrl: "http://localhost:3000",
  // apiKey: "my-secret-key",  // include if PRAMANA_API_KEY is set on the server
});

// Check server health
const health = await client.health();
console.log(health.status);   // "ok"
console.log(health.version);  // "1.0.0"

// Execute a governance decision
const attestation = await client.execute({
  policy_id:      "loan-approval",
  policy_version: "v1",
  decision_type:  "approve",
  signals_hash:   "abc123signals",
});

console.log(attestation.result.decision);  // "approve"
console.log(attestation.signature);         // base64 Ed25519 signature

// Independently verify the attestation
const verification = await client.verify(attestation);
console.log(verification.valid);                          // true
console.log(verification.checks.signature_verified);      // true
console.log(verification.checks.runtime_verified);        // true
console.log(verification.checks.schema_compatible);       // true

API

new PramanaClient(options)

const client = new PramanaClient({
  baseUrl: "https://governance.example.com",
  apiKey:  "your-bearer-token",  // optional
});

| Option | Type | Required | Description | |---|---|---|---| | baseUrl | string | Yes | Base URL of the PramanaSystems server | | apiKey | string | No | Sent as Authorization: Bearer <apiKey> |


client.health(): Promise<HealthResponse>

const { status, version, timestamp } = await client.health();

client.execute(request): Promise<ExecutionAttestation>

Runs the governance execution pipeline. Returns a signed ExecutionAttestation.

const attestation = await client.execute({
  policy_id:      "claims-processing",
  policy_version: "v2",
  decision_type:  "approve-claim",
  signals_hash:   "sha256-of-signals-payload",
});

| Field | Type | Description | |---|---|---| | policy_id | string | Policy identifier | | policy_version | string | Semantic version of the policy | | decision_type | string | Decision type to execute | | signals_hash | string | SHA-256 hex digest of the input signals |


client.verify(attestation): Promise<VerificationResult>

Independently verifies an attestation. Pass the return value from execute() directly.

const result = await client.verify(attestation);

if (!result.valid) {
  console.error("Attestation verification failed:", result.checks);
}

Error handling

Non-2xx responses throw PramanaApiError:

import { PramanaClient, PramanaApiError } from "@pramanasystems/sdk-client";

try {
  await client.execute({ ... });
} catch (err) {
  if (err instanceof PramanaApiError) {
    console.error(`HTTP ${err.status}: ${err.message}`);
  }
}

PramanaApiError.message is populated from the server's { error: string } response body, or from the HTTP status text if parsing fails.


Types

All types are derived via indexed-access from openapi.d.ts (generated from openapi.json) and re-exported from the package index:

import type {
  HealthResponse,
  ExecuteRequest,
  ExecutionResult,
  ExecutionAttestation,
  VerificationResult,
  ApiErrorBody,
  PramanaClientOptions,
} from "@pramanasystems/sdk-client";

Regenerating types

If you modify openapi.json, regenerate the type definitions:

cd packages/sdk-client
npm run generate   # runs: openapi-typescript ../../openapi.json -o src/openapi.d.ts
npm run build

License

Apache-2.0