@pshkv/client
v0.1.0
Published
SINT Client SDK — TypeScript client for the SINT Gateway
Readme
@sint/client
TypeScript SDK for the SINT Gateway API. Supports token delegation, policy queries, SSE streaming, and approval workflows.
Install
npm install @sint/clientUsage
import { SintClient } from "@pshkv/client";
const client = new SintClient({
baseUrl: "http://localhost:3100",
apiKey: "your-api-key",
});
// Check gateway health
const health = await client.health();
// Request a policy decision
const decision = await client.intercept({
tokenId: "tok-abc",
resource: "file:///workspace/output.txt",
action: "write",
});
// Stream real-time decisions via SSE
const stream = client.subscribe({ sessionId: "agent-001" });
for await (const event of stream) {
console.log(event.type, event.decision);
}
// Delegate a token
const delegated = await client.delegate({
parentTokenId: "tok-abc",
delegateeDid: "did:key:z6Mk...",
permissions: { resources: ["file:///output/**"], actions: ["read"] },
ttlSeconds: 600,
});