@3d3n_!/sdk
v0.1.0
Published
Minimal SDK for AgentAuth. Auto-discovers endpoints, exchanges API keys for JWTs, auto-refreshes tokens, and provides a `fetch` wrapper.
Readme
@agentauth/sdk
Minimal SDK for AgentAuth. Auto-discovers endpoints, exchanges API keys for JWTs, auto-refreshes tokens, and provides a fetch wrapper.
Install
npm install @agentauth/sdkUsage
import { createAgentAuth } from "@agentauth/sdk";
const auth = createAgentAuth({
issuer: "http://localhost:8080",
apiKey: process.env.AGENT_API_KEY,
scopes: ["read:orders"]
});
await auth.loginWithApiKey(); // or pass apiKey explicitly
const res = await auth.fetch("/orders");
console.log(await res.json());