TypeScript SDK and CLI

TypeScript SDK and CLI

Use the typed client in applications or the CLI in scripts and terminals.

The official TypeScript SDK covers the public API with typed resources, cursor pagination, stable errors, request identifiers, retry behavior, and idempotency support. The CLI exposes the same project, evidence, operational, webhook, crawl, and export workflows for scripts and terminals.

Safe reads may be retried automatically. Mutations are retried only when the caller supplies an idempotency key, preventing a network failure from silently duplicating a state change.

Keep credentials outside source control, record idempotency keys for retried jobs, and persist resource identifiers returned by mutations. Pin a compatible SDK version and review the OpenAPI changelog before adopting a newer contract in production.

Verified against the current productUpdated July 26, 2026

TypeScript SDK

The SDK covers the complete public API, including typed resources, cursor pagination, stable errors, request identifiers, retry policy, and idempotency helpers.

Start and inspect a scan
import { SightClient } from "@sight/sdk";

const sight = new SightClient({
  apiKey: process.env.SIGHT_API_KEY!,
  baseUrl: process.env.SIGHT_API_URL,
});

const started = await sight.startScan("site_123", {
  idempotencyKey: "scan-site-123-2026-07-26",
});
const scan = await sight.getScan(started.data.id);

CLI

The sight command supports project, scan, report, prompt, evidence, alert, credit, crawl-insight, webhook, and export workflows.

Examples
export SIGHT_API_KEY=wrk_your_secret
export SIGHT_API_URL=https://YOUR_SIGHT_HOST

bun run sight projects --limit 25
bun run sight source-gaps --site-id site_123
bun run sight export answers --format jsonl --idempotency weekly-answers
bun run sight export-download export_123

Retry mutations intentionally

The client retries safe reads automatically. It retries a mutation only when an idempotency key is present.