open-index/open-npm huggingface dataset:
npm package: @nozomioai/nia-sdk
Description: Type-safe TypeScript SDK for the public Nia API.
Latest version: 0.0.5

# `@nozomioai/nia-sdk`

Type-safe TypeScript SDK for the public Nia API.

## Install

```bash
bun add @nozomioai/nia-sdk
```

`@nozomioai/nia-sdk` is a public Eden-based client for the public Nia API surface.

## Usage

```ts
import { createClient } from "@nozomioai/nia-sdk";

const client = createClient("https://api.nia.ai", {
	apiKey: process.env.NIA_API_KEY,
});

const sources = await client.sources.get();
```

The SDK is typed from the backend `publicApi` contract, so it only exposes public or API-key-safe endpoints.

## Authentication

`createClient()` can set a default `Authorization` header for every request:

```ts
const client = createClient("https://api.nia.ai", {
	apiKey: process.env.NIA_API_KEY,
});
```

Pass your API key in `apiKey`. The SDK adds the `Bearer ` prefix automatically. Internal session-token auth stays in `@nia/api-client` and is intentionally not part of the public SDK surface.

## Examples

List available sources:

```ts
const response = await client.sources.get();
```

## Notes

- Public routes currently cover search, sources, and usage endpoints.
- Public OpenAPI auth is API-key based.
- Route types are inferred from the backend app's TypeScript route definitions.
- The backend does not perform runtime response validation for SDK generation.