> ## Documentation Index
> Fetch the complete documentation index at: https://vlyai-1c28d863.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK

> @vly/sdk — full type safety, streaming support, automatic retries, and OpenAPI-generated types.

The official TypeScript / JavaScript SDK. Full type safety from the OpenAPI spec, async iterators for pagination, automatic retry on transient errors.

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @vly/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @vly/sdk
  ```

  ```bash yarn theme={null}
  yarn add @vly/sdk
  ```

  ```bash bun theme={null}
  bun add @vly/sdk
  ```
</CodeGroup>

## Quick start

```typescript theme={null}
import { Vly } from "@vly/sdk";

const vly = new Vly({ apiKey: process.env.VLY_API_KEY! });

// List projects
const { data: projects } = await vly.projects.list({ limit: 20 });

// Create a project
const project = await vly.projects.create({
  name:   "Tasks for teams",
  prompt: "A real-time task tracker...",
  agent:  "claude-code",
});

// Trigger an agent run
const run = await vly.agents.run({
  projectId: project.id,
  prompt:    "Add a settings page",
});

// Stream output
for await (const chunk of run.stream()) {
  console.log(chunk);
}
```

## Async iteration

```typescript theme={null}
for await (const project of vly.projects.iterate({ limit: 100 })) {
  console.log(project.name);
}
```

Handles pagination internally.

## Error handling

```typescript theme={null}
import { VlyError } from "@vly/sdk";

try {
  await vly.projects.create({ /* ... */ });
} catch (err) {
  if (err instanceof VlyError) {
    console.log(err.code, err.message);
    if (err.code === "key_rate_limited") {
      // wait and retry
    }
  }
}
```

## Configuration

```typescript theme={null}
const vly = new Vly({
  apiKey:   process.env.VLY_API_KEY!,
  baseUrl:  "https://api.vly.ai",     // override for staging
  timeout:  30_000,                    // request timeout (ms)
  maxRetries: 3,                       // automatic retries on 429/5xx
});
```

## Related

<CardGroup cols={3}>
  <Card title="Python SDK" icon="code" href="/api-reference/sdks/python">
    Same surface, Python.
  </Card>

  <Card title="CLI" icon="terminal" href="/api-reference/sdks/cli">
    Same API, terminal.
  </Card>

  <Card title="Webhooks SDK" icon="webhook" href="/api-reference/sdks/webhooks">
    Webhook signature verification helpers.
  </Card>
</CardGroup>


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