@trigguard/gateway-client
v0.1.1
Published
TrigGuard Gateway Client
Maintainers
Readme
@trigguard/gateway-client
Official Node.js (18+) client for the TrigGuard execution gateway — a thin fetch-based wrapper around POST /execute.
Install (from npm)
npm install @trigguard/gateway-clientLocal / path install (monorepo)
npm install file:./sdk/nodeUsage
const { Client } = require("@trigguard/gateway-client");
const client = new Client({
apiKey: process.env.TG_API_KEY, // e.g. tg_live_... from control plane
baseUrl: "https://your-gateway.example.com", // or http://127.0.0.1:8080
});
const result = await client.execute({
surface: "spendCommit",
signals: { riskScore: 0.9 },
context: { amount: 1000 },
});
console.log(result.decision, result.execution_id, result.receipt);- Auth:
Authorization: Bearer <apiKey> - Errors:
TrigGuardErroron non-2xx (includesstatus,body,request_idwhen present)
Publish (maintainers)
cd /path/to/TrigGuard/sdk/node
npm login
npm run publish:npmPyPI (Python package): run from repo root, not from sdk/node: bash scripts/publish-pypi.sh (see sdk/python/README.md).
See also
- SDK quickstart (repo)
- Full TypeScript / protocol SDK:
sdk/js/trigguard(@trigguard/sdkin that tree)
