@trigguard/provider-sdk
Public API for building TrigGuard providers — adapters that map a vendor payload (webhook body, admission review, payment object) to a canonical ExecutionRequest for POST /execute.
This package has no HTTP client and no policy logic. Execution and receipt verification stay in @trigguard/execution-sdk; the gateway evaluates policy.
Install
npm install @trigguard/provider-sdk
Usage
import {
defineProvider,
type ExecutionRequest,
} from "@trigguard/provider-sdk";
export const acmeProvider = defineProvider({
id: "acme",
name: "Acme API",
defaultSurface: "dataExport",
mapAction(input: unknown): ExecutionRequest {
const o = input as { userId?: string };
return {
surface: "dataExport",
actorId: o.userId ?? "unknown",
context: { source: "acme" },
};
},
});
Register with ProviderRegistry (also exported from this package) or publish as a standalone npm module (@trigguard/provider-acme).
Related
packages/trigguard-providers — first-party adapters (github, stripe, …)
docs/PROTECTION_MODULES.md — copy-paste “protection modules” and examples index