@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-client
Local / path install (monorepo)
npm install file:./sdk/node
Usage
const { Client } = require("@trigguard/gateway-client");
const client = new Client({
apiKey: process.env.TG_API_KEY,
baseUrl: "https://your-gateway.example.com",
});
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:
TrigGuardError on non-2xx (includes status, body, request_id when present)
Publish (maintainers)
cd /path/to/TrigGuard/sdk/node
npm login
npm run publish:npm
PyPI (Python package): run from repo root, not from sdk/node: bash scripts/publish-pypi.sh (see sdk/python/README.md).
See also