@nolgia/sdk
v0.1.0
Published
Official TypeScript client for the Nolgia API (generative media: image, audio, video)
Readme
@nolgia/sdk — TypeScript SDK
Official TypeScript client for the Nolgia API. Types are
generated from api/openapi.yaml with
openapi-typescript; the runtime is
openapi-fetch (peer dependency, ~6 kB).
Not yet published to npm. Install from the repo for now.
Install
npm install openapi-fetch github:nolgiainc/nolgia-api#main&path:/sdk/typescriptUsage
Authenticate with a personal access token (nol_...) or a JWT:
import { createNolgiaClient } from "@nolgia/sdk";
const nolgia = createNolgiaClient("nol_...");
const { data: me, error } = await nolgia.GET("/me");
const { data: image } = await nolgia.POST("/generate/image", {
body: { prompt: "a red fox in the snow", model: "imagen-4" },
});Point at staging with createNolgiaClient(token, "https://api.stg.nolgia.ai/v1").
Layout
src/types.gen.ts— generated, do not edit; regenerate withmake sdk-tsfrom the repo rootsrc/index.ts,package.json,tsconfig.json— hand-written
