actiongate-sdk
v0.2.0
Published
TypeScript SDK for the ActionGate API and payment proxy.
Maintainers
Readme
actiongate-sdk
TypeScript SDK for the ActionGate API.
Install
npm install actiongate-sdkCustom Proxy Usage
Use these methods when your deployment exposes custom tools through /proxy/:toolName.
import { ActionGateClient } from "actiongate-sdk";
const client = new ActionGateClient({ baseUrl: "https://api.actiongate.xyz" });
const summary = await client.proxyCall("external_summary", {
text: "Summarize this payload",
tags: ["finance", "treasury"],
});proxyCall(toolName, args, options?) returns the parsed response body.
proxyCallWithMeta(...) returns { data, payment_response }.
options.method can override the HTTP verb. GET and DELETE send args as query parameters.
POST, PUT, and PATCH send args as a JSON body. options.headers adds per-call headers.
Safety Methods
riskScore(payload)riskScoreWithMeta(payload)simulate(payload)simulateWithMeta(payload)policyGate(payload)policyGateWithMeta(payload)
Example
import { ActionGateClient } from "actiongate-sdk";
const client = new ActionGateClient({ baseUrl: "https://api.actiongate.xyz" });
const result = await client.riskScore({
actor: { actor_id: "treasury-bot" },
action: { action_type: "transfer", network: "base", asset_symbol: "USDC", amount: "2500" }
});x402 V2 Support
- Sends
PAYMENT-SIGNATUREwhenpaymentSignatureis configured. - Parses
PAYMENT-REQUIREDandPAYMENT-RESPONSEheaders. - Exposes parsed payment metadata in
ActionGateErrorand*WithMetacalls.
