Skip to main content

Documentation Index

Fetch the complete documentation index at: https://parmanasystems.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

@parmanasystems/sdk-client is a typed HTTP client for the Parmana Systems REST API. Types are generated directly from the live OpenAPI schema (openapi.json) so the client always matches the server.

Install

npm install @parmanasystems/sdk-client

Usage

import { ParmanaClient } from "@parmanasystems/sdk-client";

const client = new ParmanaClient({
  baseUrl: "http://localhost:3000",
  apiKey:  process.env.PARMANA_API_KEY, // optional
});

// Execute a governed decision
const result = await client.execute({
  policyId:      "claims-approval",
  policyVersion: "v1",
  signals: {
    insurance_active: true,
    risk_score:       42,
    vip_customer:     false,
    claim_amount:     8500,
  },
});

console.log(result.execution_state); // "completed"
console.log(result.signature);       // Ed25519 base64

// Verify an attestation via the server
const verification = await client.verify({
  executionId:     result.executionId,
  decision:        result.decision,
  execution_state: result.execution_state,
  runtimeHash:     result.runtimeHash,
  signature:       result.signature,
});

console.log(verification.valid); // true

Configuration

OptionTypeDescription
baseUrlstringBase URL of the Parmana Systems server
apiKeystring (optional)Bearer token for authentication

Type generation

The TypeScript types are generated from openapi.json using openapi-typescript:
npm run generate --workspace packages/sdk-client
This regenerates src/openapi.d.ts. Run this after any server API change to keep the client in sync.

When to use the SDK client vs. the core SDK

ScenarioRecommended package
Embedded governance (in-process, same Node.js app)@parmanasystems/core
Remote governance (HTTP call to Parmana Systems server)@parmanasystems/sdk-client
Microservice calling the governance server@parmanasystems/sdk-client
Independent verification in a separate service@parmanasystems/verifier