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

# SDKs

> Official JavaScript and Python clients, plus how to generate your own from our OpenAPI spec.

## Status

| SDK                     | Package                                                          | Status                        |
| ----------------------- | ---------------------------------------------------------------- | ----------------------------- |
| JavaScript / TypeScript | [`@barker/sdk-js`](https://www.npmjs.com/package/@barker/sdk-js) | **Alpha** — pin exact version |
| Python                  | [`barker-sdk`](https://pypi.org/project/barker-sdk/)             | **Alpha** — pin exact version |

Both SDKs are thin clients generated from our [OpenAPI spec](https://docs.barker.money/api-reference/openapi.yaml). They handle auth, retries, and typed responses — nothing magic.

## JavaScript / TypeScript

### Install

```bash theme={null}
npm install @barker/sdk-js
# or
pnpm add @barker/sdk-js
```

### Use

```ts theme={null}
import { createBarkerClient } from "@barker/sdk-js";

const barker = createBarkerClient({
  apiKey: process.env.BARKER_API_KEY!,
});

// List products
const { data, error } = await barker.GET("/api/partner/products");
if (error) throw new Error(error.message);
console.log(data);
```

### Configuration

| Option    | Default                    | Notes                               |
| --------- | -------------------------- | ----------------------------------- |
| `apiKey`  | — (required)               | `bk_live_*`                         |
| `baseUrl` | `https://api.barker.money` | Override only for self-host / proxy |
| `timeout` | `15000` ms                 | Per request                         |
| `retry`   | `3` on idempotent + 5xx    | Exponential backoff                 |

## Python

### Install

```bash theme={null}
pip install barker-sdk
```

### Use

```python theme={null}
from barker import BarkerClient

barker = BarkerClient(
    api_key=os.environ["BARKER_API_KEY"],
)

products = barker.products.list()
for p in products:
    print(p.slug, p.latest_metrics.net_apy_for_user)
```

## Generate your own client

If your language isn't covered or you want full control, point any OpenAPI codegen tool at our spec:

```
https://docs.barker.money/api-reference/openapi.yaml
```

Recommended generators:

* TypeScript: [`openapi-typescript`](https://github.com/drwpow/openapi-typescript) + [`openapi-fetch`](https://github.com/drwpow/openapi-typescript/tree/main/packages/openapi-fetch)
* Python: [`openapi-python-client`](https://github.com/openapi-generators/openapi-python-client)
* Go: [`oapi-codegen`](https://github.com/oapi-codegen/oapi-codegen)
* Rust: [`progenitor`](https://github.com/oxidecomputer/progenitor)

The spec is the source of truth — official SDKs are regenerated from it on every release.
