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

# TypeScript/JavaScript SDK

> Official TypeScript/JavaScript SDK with decorator-based function monitoring

## Overview

The official Velatir SDK for TypeScript and JavaScript provides a simple decorator-based approach to add human-in-the-loop approval to your functions.

Simply decorate any function with `@reviewTask()` and Velatir will:

* Intercept function calls and create approval requests
* Route requests through your configured agents
* Wait for human approval before executing sensitive operations
* Handle denials gracefully with detailed feedback

## Quick Example

```typescript theme={null}
import * as velatir from '@velatir/sdk';

velatir.init({ apiKey: "your-api-key" });

class EmailService {
  @velatir.reviewTask()
  async sendEmail(to: string, subject: string, body: string): Promise<void> {
    // Your email sending logic here
  }
}
```

## Installation & Documentation

Get the latest version and complete documentation from npm:

<Card title="@velatir/sdk on npm" icon="npm" href="https://www.npmjs.com/package/@velatir/sdk">
  Install with `npm install @velatir/sdk` - includes full API reference, examples, and TypeScript support
</Card>

## Features

* **Decorator-based integration** - Just add `@reviewTask()` to any function
* **Full TypeScript support** - Complete type safety and IntelliSense
* **Async/sync support** - Works with both synchronous and asynchronous functions
* **Configurable polling** - Customise approval timeout and retry behaviour
* **Rich metadata** - Add context for better approval routing
* **Error handling** - Graceful handling of denials with feedback

***

<CardGroup cols={2}>
  <Card title="Python SDK" icon="python" href="/integrations/python-sdk">
    Python integration with decorators
  </Card>

  <Card title="LangChain Integration" icon="link" href="/integrations/langchain">
    Native LangChain middleware
  </Card>
</CardGroup>
