# SDK

The Voxcode SDK enables embedding agent workflows into your own Node.js or TypeScript applications. It exports the full public API surface from `@voxcode-dev/voxcode`.

## Installation

```bash
npm install @voxcode-dev/voxcode
```

Requires Node.js `>= 22.19.0`.

## Usage

```typescript
import { createSession, VoxcodeConfig } from "@voxcode-dev/voxcode";

const config: VoxcodeConfig = {
  provider: "anthropic",
  model: "claude-sonnet-4-20250514",
};

const session = await createSession(config);
const result = await session.run("Explain the architecture of this project");
console.log(result.output);
```

## SDK Surface

The SDK provides:

- **Session management** — create, resume, branch, and compact sessions
- **Agent orchestration** — run prompts, stream responses, handle tool calls
- **Configuration** — programmatic config with the same schema as JSON settings
- **Extension loading** — load and register extensions at runtime
- **Provider abstraction** — multi-provider support with a unified interface

## Typical Use Cases

- Internal automation tools
- CI assistant workflows
- Custom developer portals
- Programmatic session orchestration

## TypeScript

The SDK is written in TypeScript and ships with full type definitions. Import types directly:

```typescript
import type { Session, VoxcodeConfig, ExtensionContext } from "@voxcode-dev/voxcode";
```

See package-level APIs in `../README.md` and source docs.
