New:Socket for Asana Is Now Available.Learn more
Get Started

trigguard

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trigguard

Official JavaScript SDK for the TrigGuard Protocol

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
167
351.35%
Maintainers
1
Weekly downloads
 
Created
Source

TrigGuard JavaScript SDK

npm install trigguard
import { TrigGuard, TrigGuardError } from "trigguard";

const tg = new TrigGuard();

const receipt = {
  decision: "PERMIT",
  timestamp: new Date().toISOString(),
};

try {
  const result = await tg.verify.receipt(receipt);
  console.log(result.valid, result);
} catch (err) {
  if (err instanceof TrigGuardError) {
    console.error(err.code, err.message, err.request_id);
  }
  throw err;
}

Install → construct client → call → handle TrigGuardError predictably.

Install

npm install trigguard

From a git clone:

npm install ./path/to/trigguard-js

Custom authority (enterprise / self-hosted)

const tg = new TrigGuard({
  authority: "https://trigguardai.com",
});

You can also pass a string shorthand: new TrigGuard("https://your-authority.example").

Environment fallbacks (Node): TRIGGUARD_AUTHORITY or TRIGGUARD_BASE_URL when no constructor argument is given.

curl (no install)

curl -sS https://trigguardai.com/protocol/test-vectors | head
curl -sS -X POST https://trigguardai.com/protocol/verify-receipt \
  -H "Content-Type: application/json" \
  -d '{"decision":"PERMIT","timestamp":"2026-01-01T00:00:00.000Z"}'

Runnable example in this repo

node examples/verify-receipt.js

API

MemberDescription
new TrigGuard(options?)Client; default authority https://trigguardai.com
tg.authorityResolved origin (no trailing slash)
tg.verify.receipt(body)POST /protocol/verify-receipt
tg.verify.signature(body)POST /protocol/verify-signature
tg.protocol.capabilities()GET /protocol/capabilities

Errors

Failures throw TrigGuardError (extends Error):

  • err.code — machine-readable (from API when present, else HTTP_ERROR / NETWORK_ERROR)
  • err.message — human-readable
  • err.request_id — when the authority returns one
  • err.status — HTTP status when applicable
  • err.body — parsed JSON body when available
  • err.toJSON() — stable shape for logs

What this is

TrigGuard is execution-governance infrastructure: deterministic PERMIT / DENY / SILENCE before irreversible actions, with verifiable receipts. This package is a small HTTP client for the public protocol endpoints. Policy evaluation lives in authority / hosted services — not in this SDK.

  • Types & constants (npm): @trigguard/protocol
  • Core monorepo: TrigGuard-AI/TrigGuard
  • This SDK: TrigGuard-AI/trigguard-js

License

Apache-2.0 — see LICENSE and NOTICE.

Keywords

trigguard

FAQs

Package last updated on 22 Mar 2026

Related posts