> ## 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.

## 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

> [card] [API reference](https://developers.lighton.ai/sdks/typescript/reference.md)
>
> Every public class, method, and type, generated from the installed SDK.

> [card] [Tutorials](https://developers.lighton.ai/tutorials/index.md)
>
> Task-by-task walkthroughs, each with a **TypeScript SDK** tab.

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).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.