@agentkeys-io/sdk
v0.1.2
Published
TypeScript SDK for AgentKeys — proxy API calls through secure credential vault
Maintainers
Readme
@agentkeys-io/sdk
TypeScript SDK for AgentKeys — proxy API calls through a secure credential vault. Your agent never sees the real API keys.
Install
npm install @agentkeys-io/sdkUsage
With API key (recommended — access all credentials by name)
import { AgentKeys } from "@agentkeys-io/sdk";
const ak = new AgentKeys({
token: "ak_ws_your_key...",
proxyUrl: "https://proxy.agentkeys.io",
});
// Proxy a request through the "resend" credential
const response = await ak.proxy("resend", {
url: "https://api.resend.com/emails",
method: "POST",
body: {
},
});
console.log(await response.json());With proxy token (single credential)
const ak = new AgentKeys({ token: "pxr_resend_abc123..." });
const response = await ak.proxy("ignored", {
url: "https://api.resend.com/emails",
method: "POST",
body: { "from": "[email protected]", "to": "[email protected]", "subject": "Hello", "text": "Sent via AgentKeys"},
});Scoped client
const resend = ak.for("resend");
const stripe = ak.for("stripe");
await resend.post("https://api.resend.com/emails", {
from: "[email protected]",
to: "[email protected]",
subject: "Hello",
text: "Sent via AgentKeys",
});
const balance = await stripe.get("https://api.stripe.com/v1/balance");