> ## Documentation Index
> Fetch the complete documentation index at: https://developers.lighton.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript quick start

> Install @lighton-ai/sdk and get your first grounded answer.

[`@lighton-ai/sdk`](https://github.com/lightonai/lighton-typescript-sdk) wraps the LightOn API: typed models, pagination handled for you, and rate-limit pacing built in. It's the code shown in the **TypeScript SDK** tab of every tutorial snippet.

<Tip>
  Requires Node 22 or later. Also runs on Bun, Deno, Cloudflare Workers, Vercel Edge, and in the browser, with no runtime dependencies.
</Tip>

## Install

```bash theme={null}
npm install @lighton-ai/sdk
```

Set your API key in the environment. `new LightOn()` reads it from there, so it never appears in your code:

```bash theme={null}
export LIGHTON_API_KEY="..."
```

## Your first result

```typescript theme={null}
import { LightOn, Workspace } from "@lighton-ai/sdk"

const client = new LightOn() // reads LIGHTON_API_KEY from the environment
const workspace = await new Workspace({ name: "Docs" }).create(client)
await workspace.ingestMany(["docs/**/*.pdf"], { wait: true })

const answer = await client.ask("What were Q4 revenues?", { workspaces: [workspace] })
console.log(answer.answer)
```

## Where to go next

<Columns cols={2}>
  <Card title="API reference" icon="code" href="/sdks/typescript/reference">
    Every public class, method, and type, generated from the installed SDK.
  </Card>

  <Card title="Tutorials" icon="graduation-cap" href="/tutorials/index">
    Task-by-task walkthroughs, each with a **TypeScript SDK** tab.
  </Card>
</Columns>

For structured output with Zod, async jobs, error handling, and agent-framework integrations (Vercel AI SDK, LangChain.js), see the [SDK README](https://github.com/lightonai/lighton-typescript-sdk#readme).
