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

# The TypeScript SDK

> Every route of this API, one line from your app, typed.

One client, configured from the environment; every route a method; every answer a typed model. The
SDK signs, retries and checks for you, and a test of any call is three lines.

> [card] [@fetchski/attract-cms-sdk](https://docs.fetchski-attract.com/typescript/installation.md)
>
> Node 26.12.1+ · Bun · modern browsers

```ts Call it theme={"dark"}
import { createSiteClient } from '@fetchski/attract-cms-sdk';

const site = createSiteClient();
const blog = await site.blogPosts().getBlog({ id: 'example-id' }); // blog.title, blog.publishedAt
```

```ts Test it theme={"dark"}
import { fakeSite } from '@fetchski/attract-cms-sdk/testing';

const site = fakeSite();
await site.blogPosts().getBlog({ id: 'example-id' });
site.assertCalled('blogPosts.getBlog');
```

## What it does for you

> [card] Typed models
>
> Always-sent fields never optional, `Date`s for dates, enums you can compare against.

> [card] Safe retries
>
> Rate limits waited out; reads retried when the site doesn't answer.

> [card] Whole lists
>
> `for await` over `…All()`, however the list pages.

> [card] Typed errors
>
> One class per failure, with the site's own words and each field's problem.

> [card] Checked answers
>
> Every answer checked against its type before your code sees it.

> [card] Three-line tests
>
> `fakeSite()`, a factory for every model, and `assertCalled`.

## The guides

**1. Installation**

Install it from your own site, with any of its API keys. [Install the SDK →](https://docs.fetchski-attract.com/typescript/installation.md)

**2. Configuration**

Zero-config from the environment, or options. [Configure →](https://docs.fetchski-attract.com/typescript/configuration.md)

**3. Calling the API**

Arguments, models, lists, ids and uploads. [Make calls →](https://docs.fetchski-attract.com/typescript/calling-the-api.md)

**4. Errors, paging and testing**

[Errors](https://docs.fetchski-attract.com/typescript/errors.md) · [Paging](https://docs.fetchski-attract.com/typescript/paging.md) · [Testing](https://docs.fetchski-attract.com/typescript/testing.md)

## The reference

Every method has its own page in this tab's sidebar, grouped like the API reference.

> [card] The call, ready to copy
>
> One line, pinned beside the page.

> [card] Its arguments
>
> The one object it takes, each field typed, a body's fields among them.

> [card] What it returns
>
> Each property of the model, typed, with nested models one click away.

> [card] Its test
>
> A three-line `fakeSite()` test, ready to run.

> [card] [Start with Pages → List](https://docs.fetchski-attract.com/typescript/reference/pages/list-pages.md)
>
> The first method in the reference.

> [card] [Building a new app? Try AdonisJS](https://docs.fetchski-attract.com/adonisjs/overview.md)
>
> TypeScript's answer to Laravel: a container, Lucid, Ace commands and Japa tests, with the SDK wired
> in. The AdonisJS tab walks through every file.

> [!NOTE]
>
> Your own site serves the package: any of its API keys installs it, no other account needed.
> Using Laravel? See the [Laravel SDK](https://docs.fetchski-attract.com/laravel/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.