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

# TypeScript SDK

> Install and use the Agent Office TypeScript SDK

## Installation

```bash theme={null}
npm install agent-office-sdk
```

## Documentation

View the full SDK documentation on npm:

<Card title="agent-office-sdk on npm" icon="npm" href="https://www.npmjs.com/package/agent-office-sdk">
  Complete TypeScript SDK documentation and API reference
</Card>

## Quick Example

```typescript theme={null}
import { AgentOffice } from "agent-office-sdk";
import { v4 as uuidv4 } from "uuid";
import fs from "fs";

const client = new AgentOffice({
  apiKey: process.env.AGENT_OFFICE_API_KEY || "",
});

const fileBuffer = fs.readFileSync("document.docx");
const file = new File([fileBuffer], "document.docx", {
  type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
});

// Upload with tracked changes enabled
const { docId, markdown } = await client.documents.create({
  file: file,
  returnMarkdown: true,
  trackedChanges: true,
  authorName: "John Doe",
});

// Edit the document
const editResult = await client.edit({
  docId: docId,
  editUid: uuidv4(),
  editInstructions: "Change the title to 'My New Title'",
  saveChunksForReview: false,
});

// Download the edited document
const { downloadUrl } = await client.documents.download({
  docId: docId,
});
```
