# TypeScript SDK: Typed requests. Safe retries. One wait.

@kaabist/sdk gives you every API operation as a typed method, retries that never run a job twice, and a wait helper that can answer a job's questions as it goes.

## Setup

```sh
npm install @kaabist/sdk
```

## Run a job

Create a job and hold the request open for its result. The client reads KAAB_API_KEY from the environment.

```
import { Kaab } from "@kaabist/sdk";

const kaab = new Kaab();
const job = await kaab.jobs.create({
  program: "renew-subscription@production",
  inputs: { account: "A-1042" },
  wait: 30,
});
```

## Wait, and answer

jobs.wait long-polls until the job ends. Give it onInput to supply a one-time code the job asks for, and onAttention to decide what to do when it needs attention.

## Retries that cannot run twice

jobs.create always sends an Idempotency-Key, so a retried create returns the same job. Pass your own key to make your retries safe too.

Guide: http://localhost:3001/guides/sdks
