Sign In

trigguard-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trigguard-js

TrigGuard JS client: gateway helpers, autoguard, and Express middleware for canonical POST /decide

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

trigguard-js

JavaScript utilities for TrigGuard, including createTrigguardMiddleware for Express routes that call the canonical decision authority (POST /decide).

Express middleware

Default authority URL: https://api.trigguardai.com/decide. Only PERMIT continues to your handler; DENY, SILENCE, timeouts, and invalid responses return HTTP 403 with { "blocked": true, "reasonCode": "…" }.

import express from "express";
import { createTrigguardMiddleware } from "trigguard-js";

const app = express();
app.use(express.json());

app.post(
  "/charge",
  createTrigguardMiddleware({
    surface: "spendCommit",
    token: process.env.TRIGGUARD_TOKEN,
    signals: (req) => ({ riskScore: req.body.riskScore }),
    context: (req) => ({ amount: req.body.amount, origin: "api" }),
  }),
  (req, res) => res.json({ charged: true })
);

See docs/quickstart/express.md and examples/express-spend-guard/ in this repository.

Other exports

Gateway /execute helpers (authorize, guard, …), manifest loading, and autoguard utilities remain available from the same package entry.

License

Apache-2.0

Keywords

trigguard

FAQs

Package last updated on 25 Apr 2026

Related posts