@alter-ai/alter-sdk
v0.13.0
Published
Official TypeScript SDK for Alter Vault — OAuth token management with policy enforcement
Downloads
704
Readme
Alter SDK for TypeScript / Node.js
Official TypeScript SDK for Alter Vault — credential and authorization layer for apps and AI agents that call third-party APIs.
Tokens stay in the vault. The SDK injects the credential, refreshes it, and writes the audit row — application code only calls vault.request().
Install
npm install @alter-ai/alter-sdkRuns on Node.js 20+ and is intended for server-side environments. For browser-side OAuth popup flows, see @alter-ai/connect.
Quick example
Make an authenticated API call — no token ever touches application code.
import { App, HttpMethod } from "@alter-ai/alter-sdk";
const vault = new App({ apiKey: "<api-key>" });
try {
const response = await vault.request(
HttpMethod.POST,
"https://api.example.com/resource",
{
grantId: "<grant-id>",
json: { example: "payload" },
},
);
console.log(response.status, await response.json());
} finally {
await vault.close();
}For a full walkthrough — sign-up, key minting, OAuth — see the First 5 Minutes guide.
Documentation
Full docs are at https://docs.alterauth.com.
| Topic | Page |
|---|---|
| Getting started end-to-end | First 5 Minutes |
| Concepts (principals, grants, identity resolution) | Concepts |
| OAuth flows (JWT, grant_id, headless) | OAuth |
| Identity Provider setup | Identity Providers |
| Managed secrets | Managed Secrets |
| Agents and workload identity | Agents |
| Per-method API reference | SDK reference |
| Browser popup SDK | @alter-ai/connect |
License
MIT. See LICENSE.
Support
Email [email protected] or open an issue at https://github.com/alter-ai/alter-vault.
