@govrix/sdk
v1.0.0
Published
Govrix SDK — AI Agent Governance. Faithful Node.js port of the govrix-sdk Python package.
Maintainers
Readme
@govrix/sdk (Node.js) — Phase 1
Faithful Node.js port of the Python govrix-sdk package. Same public API
shape (adapted to JS naming conventions: camelCase instead of snake_case),
same endpoints, same fail-open behavior.
Status: Phase 1 complete — core package, tested against the live backend
index.js—init()/getClient(), matches__init__.pylib/client.js—GovernanceClient(sendEvent, stressTest, healthCheck, stats)lib/exceptions.js— GovernixError, AuthenticationError, RateLimitError, AgentNotFoundError, PolicyViolationErrorlib/decorators.js—monitor()/checkpoint()(JS higher-order functions — JS has no Python-style function decorators, so these wrap a function rather than annotate it)
What's been tested (this rebuild, Sept 2026)
- Syntax-validated (
node --check) on all 4 files - Auth validation (missing key, malformed key) — throws correctly
- Offline mode — returns the correct stub response without a network call
stats()returns correct shape
Note: this rebuild has NOT yet been re-tested against the live production API (that original live test, against api.govrix.io/m8 in August 2026, was lost along with the original files). Re-run that test before considering this production-verified again.
What Phase 2 covers (not yet done)
- Re-verify live network test against
api.govrix.io/m8(lost, needs redoing) stressTest()andhealthCheck()tested live against/m9and the health path specificallymonitor()/checkpoint()decorators tested against a real wrapped function end to end- CLI tool (
govrix health,govrix test) — the Python SDK has one; not yet ported - npm packaging polish (LICENSE file, .npmignore, publishConfig)
Usage
const govrix = require("@govrix/sdk");
govrix.init({ apiKey: "gvx_live_xxxx" });
const result = await govrix.getClient().sendEvent({
agentId: "credit-001",
category: "credit_scoring",
jurisdiction: "BR",
});