# SAIR Competition Public API — TypeScript examples

Runnable examples for the SAIR Competition Public API. The "client" is a single file of plain `fetch` — copy it into your own code rather than depending on this package.

## Install

Node ≥ 18.17 (uses the global `fetch` and `ReadableStream`).

```bash
npm install
```

## Type-check

```bash
npm run typecheck
```

## Run an example

```bash
export SAIR_API_KEY="sair_..."
export SAIR_COMPETITION_ID="modular-arithmetic-challenge"

npm run example:quick-start
npm run example:submit-competition
npm run example:submit-igp24
npm run example:practice-cheatsheet
npm run example:practice-solver
npm run example:contributor-network
```

The IGP24 submit example defaults to polynomial lines from the public LMFDB baseline in [`lmfdb-polynomials.txt`](./lmfdb-polynomials.txt). Set `SAIR_IGP24_LINES_FILE` to submit a different local file. Blank and full-line `#` comments are skipped; trailing comments, including `# poly_disc_primes=[...]`, are preserved.

Each example reads its config from environment variables and is independently runnable. Inspect [`src/client.ts`](./src/client.ts) for the HTTP wrapper.
