@pg-atlas/data-sdk
v0.6.0
Published
TypeScript SDK for the PG Atlas API
Downloads
15
Readme
PG Atlas TS SDK
The PG Atlas TypeScript SDK is generated from the PG Atlas OpenAPI specification.
All operation functions are generated by @hey-api/openapi-ts and re-exported from the package entrypoint.
Features
- Generated operation functions from the current OpenAPI contract
- Generated request/response types and JSON schemas
- Generated client helpers for runtime configuration (
client,createClient,createConfig)
Installation
npm add @pg-atlas/data-sdkExample Usage
Operation names are generated from operationId values in the API specification.
Use your editor autocomplete on @pg-atlas/data-sdk exports to discover the current operation names.
Basic call
import { client, getHealth } from "@pg-atlas/data-sdk";
const { data } = await getHealth({ client });
console.log(data?.status);Configure authentication (for ingest endpoints)
import { client, ingestSbom } from "@pg-atlas/data-sdk";
client.setConfig({
headers: {
Authorization: "Bearer your-github-oidc-token",
},
});
const { data } = await ingestSbom({
client,
body: mySbom,
});
console.log(data?.repository);Configuration
Configure the shared generated client using client.setConfig(...), or create per-call clients using createClient(...).
| Attribute | Default | Description |
| ---------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| baseUrl | https://api.pgatlas.xyz | The root URL of the PG Atlas API. |
| Authorization header | unset | Bearer token used for authenticated requests (for example GitHub OIDC JWT on ingest endpoints). |
License
Copyright 2026 PG Atlas Contributors
