pgbeam
v0.4.21
Published
TypeScript SDK for the PgBeam API, a Postgres proxy for safe AI agent access with policy enforcement in the wire protocol
Maintainers
Readme
pgbeam
TypeScript SDK for the PgBeam API — globally distributed PostgreSQL proxy platform with connection pooling and query caching.
Install
npm install pgbeamUsage
import { PgBeamClient } from "pgbeam";
const client = new PgBeamClient({
token: "your-api-token",
baseUrl: "https://api.pgbeam.com",
});
// Tag-based access
const projects = await client.api.projects.listProjects({
queryParams: { org_id: "org_123" },
});
// Route-based access
const project = await client.api.request("GET /v1/projects/{project_id}", {
pathParams: { project_id: "proj_123" },
});Error handling
import { PgBeamClient, ApiError } from "pgbeam";
try {
await client.api.projects.getProject({
pathParams: { project_id: "proj_123" },
});
} catch (err) {
if (err instanceof ApiError) {
console.error(err.status, err.message);
}
}Operations map
The pgbeam/operations export provides route and tag metadata for building tooling on top of the SDK:
import { operationsByTag, operationsByPath } from "pgbeam/operations";Documentation
Full API reference at pgbeam.com/docs/ts-sdk.
Contributing
Issues and pull requests are welcome here. An issue is the right place to start for a bug, a wrong doc, or a missing capability; say what you ran, what happened, what you expected, and which version you were on.
To build and test it locally:
npm install
npm run build
npm testDo not open a public issue for a suspected security vulnerability. Email [email protected], or report it privately from this repository's Security tab.
License
Apache 2.0 — see LICENSE.
