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

# Configure the client

> Set timeouts, retries, rate limits, concurrency, caching, and proxies on the TikTok SDK client.

Pass options to the `TikTokClient` constructor.

```ts theme={null}
import { TikTokClient } from '@traceryn/tiktok-sdk';

const client = new TikTokClient({
  timeout: 15000,   // keep requests from hanging too long
  maxRetries: 2,    // retry a couple of times if TikTok flakes out
  rateLimit: 3,     // slow it down a bit
  concurrency: 1,   // keep it simple and steady
  cacheTTL: 60_000, // cache results for a minute
});
```

## Options

**timeout** `number`

Request timeout in milliseconds, for example `5000`, `15000`, or `30000`.

**maxRetries** `number`

Number of retries for a failed request, for example `0`, `2`, or `5`.

**rateLimit** `number`

Rate limit for outgoing requests, for example `1`, `3`, or `10`.

**concurrency** `number`

Number of concurrent requests, for example `1`, `2`, or `4`.

**cacheTTL** `number`

How long to cache results, in milliseconds, for example `30000`, `60000`, or `300000`.

**proxy** `string | string[]`

A single proxy URL or an array of them, like `"http://user:pass@host:port"`. See [Proxies](https://traceryn.online/tiktok-sdk/proxies.md).

**proxyRotation** `string`

Proxy rotation strategy: `"round-robin"`, `"random"`, or `"lowest-failures"`.

**session** `PlaywrightSession`

A Playwright browser session for endpoints that need one. See [Playwright sessions](https://traceryn.online/tiktok-sdk/playwright-sessions.md).

## Cache

Video data is cached for `cacheTTL` milliseconds. Clear it manually when needed:

```ts theme={null}
client.invalidateCache('https://www.tiktok.com/@user/video/1234567890'); // one video
client.clearCache(); // everything
```


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