Documentation Index
Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt
Use this file to discover all available pages before exploring further.
A typed HTTP client for @parmanasystems/server. Use this when your application calls a remote governance server rather than running governance in-process.
Install
npm install @parmanasystems/sdk-client
Setup
import { GovernanceClient } from "@parmanasystems/sdk-client";
const client = new GovernanceClient({
baseUrl: "https://governance.your-domain.com",
publicKey: process.env.GOVERNANCE_PUBLIC_KEY!, // for local attestation verification
});
Executing a decision
const attestation = await client.execute({
policyId: "loan-approval",
policyVersion: "1.0.0",
signals: {
credit_score: 720,
loan_amount: 15000,
},
});
console.log(attestation.decision.action); // "approve"
Verifying a decision locally
The client can verify attestations locally using the provided public key - no round trip to the server required:
const result = client.verify(attestation);
console.log(result.valid); // true
Health check
const health = await client.health();
console.log(health.status); // "ok"
Error handling
The client throws typed errors for governance failures:
try {
const attestation = await client.execute({ ... });
} catch (error: any) {
if (error.code === "POLICY_NOT_FOUND") { /* ... */ }
if (error.code === "REPLAY_DETECTED") { /* ... */ }
if (error.code === "INVALID_SIGNALS") { /* ... */ }
}
See also