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

# Node.js Library

> Use the official TypeScript/Node.js SDK as an API client for the Ollang API.

# Node.js Library

The official TypeScript/Node.js package, `@ollang-dev/sdk`, doubles as a plain API client for the Ollang integration API — projects, uploads, orders, revisions, and custom instructions — with full TypeScript types. This page covers that programmatic use; the [Quick Start](/sdk/quickstart) and [Features](/sdk/features) pages cover the Asset Management UI and Browser SDK that ship in the same package.

Source code lives in the [SDK repository](https://github.com/ollang/sdk). Node.js 18+ is recommended.

## Installation

```bash theme={null}
npm install @ollang-dev/sdk
```

## Authentication

1. Sign up or log in at [Olabs](https://lab.ollang.com)
2. Create or select a project
3. Generate an API key from project settings

```typescript theme={null}
import Ollang from "@ollang-dev/sdk";

const ollang = new Ollang({ apiKey: process.env.OLLANG_API_KEY! });
```

## Quick Start

```typescript theme={null}
import { readFile } from "node:fs/promises";
import Ollang from "@ollang-dev/sdk";

const ollang = new Ollang({ apiKey: process.env.OLLANG_API_KEY! });

// Upload a file (creates a project)
const upload = await ollang.uploads.direct({
  file: new Blob([await readFile("./video.mp4")]),
  name: "My Video",
  sourceLanguage: "en",
});

// Create an order
const order = await ollang.orders.create({
  orderType: "cc",
  level: 1,
  projectId: upload.projectId,
  targetLanguageConfigs: [
    { language: "fr", isRush: false },
    { language: "de", isRush: false },
  ],
});

// Check order status
const status = await ollang.orders.get(order.id);
console.log(status);
```

## Resources

| Resource                    | Description                                 |
| --------------------------- | ------------------------------------------- |
| `ollang.projects`           | Read and list projects                      |
| `ollang.uploads`            | Upload files (video, audio, documents, VTT) |
| `ollang.orders`             | Create and track translation orders         |
| `ollang.revisions`          | Request revisions on completed orders       |
| `ollang.customInstructions` | Set custom translation instructions         |
| `ollang.scans`              | Scan sessions used by Asset Management      |
| `ollang.cms`                | CMS integration endpoints                   |

All methods return typed, parsed JSON responses. Non-2xx responses reject with the underlying HTTP error, which carries the response status and body.

## More Examples

```typescript theme={null}
// List orders with pagination and filters
const page = await ollang.orders.list({
  pageOptions: { page: 1, take: 20 },
  filter: { status: "completed" },
});
for (const order of page.data) {
  console.log(order.id, order.status);
}

// Request a revision on an order
await ollang.revisions.create("ORDER_ID", {
  type: "other",
  time: "00:01:23",
  description: "Fix the terminology in this segment",
});

// Custom instructions
await ollang.customInstructions.create({
  key: "tone",
  value: "Formal, brand-safe tone for all marketing content",
});
```

<Note>
  For endpoints the library doesn't wrap yet, the underlying HTTP client is
  available: `ollang.getClient().get("/integration/supported-languages")`. See
  the full [API reference](/apis/ollang-api-reference/direct-file-upload) for
  all endpoints.
</Note>
