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

# TypeScript SDK

> Install and use the Arga TypeScript SDK

## Installation

```bash theme={null}
npm install arga-sdk
```

Requires Node 18+ (uses native `fetch`). Zero runtime dependencies.

## Quick start

```typescript theme={null}
import { Arga } from 'arga-sdk';

const client = new Arga({ apiKey: 'arga_sk_...' });

// Start an ad hoc browser test run
const run = await client.testRuns.create({
  prompt: 'Test checkout with Stripe',
  startUrl: 'https://staging.myapp.com',
  twins: ['stripe'],
});

// Wait for completion
const detail = await client.testRuns.wait(run.id);
console.log(detail.status, detail.artifactsJson);
```

## Reference

<CardGroup cols={2}>
  <Card title="Runs" icon="play" href="/sdks/typescript/runs">
    Use the canonical sandbox, twin, saved-test, and test-run resources, plus legacy runs when needed.
  </Card>

  <Card title="Twins" icon="clone" href="/sdks/typescript/twins">
    Use both canonical twin runs and legacy twin quickstart helpers.
  </Card>

  <Card title="Scenarios" icon="database" href="/sdks/typescript/scenarios">
    Create reusable seed configs and use them to seed short-lived twin runs.
  </Card>

  <Card title="Error handling" icon="triangle-alert" href="/sdks/typescript/errors">
    Handle SDK API errors in TypeScript.
  </Card>

  <Card title="Examples" icon="code" href="/sdks/typescript/examples">
    Run production-style scripts from the TypeScript SDK repository.
  </Card>
</CardGroup>

## Source

[github.com/ArgaLabs/arga-typescript-sdk](https://github.com/ArgaLabs/arga-typescript-sdk)
