Generated TypeScript SDK for the Omnigraph HTTP API.
This repo is the published source for the npm package @modernrelay/omnigraph.
This is a pnpm workspace scaffolded so additional packages (e.g., an MCP
server) can be added under packages/ without restructuring.
.
├── spec/openapi.json # committed copy of upstream spec at pinned tag
├── scripts/ # spec sync + drift checks
├── packages/sdk/ # @modernrelay/omnigraph
└── .github/workflows/ # CI + release
- Bump
.omnigraph-version(a single-line file at the repo root) to match the omnigraph release tag (e.g.,0.4.0). pnpm run sync-spec— fetchesopenapi.jsonfromhttps://raw.githubusercontent.com/ModernRelay/omnigraph/v$(cat .omnigraph-version)/openapi.jsonintospec/openapi.json.pnpm run generate— regeneratespackages/sdk/src/generated/.- Commit both
spec/openapi.jsonandpackages/sdk/src/generated/. PR shows the full upstream change. - Bump
packages/sdk/package.json#versionto match.omnigraph-version. TagvX.Y.Z. release.ymlpublishes@modernrelay/omnigraph@X.Y.Zto npm.
@modernrelay/omnigraph@X.Y.Z is generated from omnigraph-server X.Y.Z and
is expected to be compatible with omnigraph-server >=X.Y.Z, <X.(Y+1).0. CI
asserts the bundled spec matches the pinned upstream tag — drift fails the
build, so a published SDK is always faithful to a real server release.
pnpm install
pnpm run sync-spec # fetch spec at pinned version
pnpm run generate # generate SDK from spec
pnpm run typecheck
pnpm run buildimport { createOmnigraphClient, listBranches } from '@modernrelay/omnigraph';
const client = createOmnigraphClient({
baseUrl: 'http://localhost:8080',
token: process.env.OMNIGRAPH_TOKEN,
});
const { data, error } = await listBranches();
if (error) throw error;
console.log(data.branches);MIT