> ## Documentation Index
> Fetch the complete documentation index at: https://proclubs-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure the client

> Set platforms, timeouts, retry limits, and a custom transport.

```ts theme={null}
import { ProClubsClient } from 'proclubs-sdk'

const proclubs = new ProClubsClient({
  platform: 'common-gen5',
  timeoutMs: 15_000,
  maxAttempts: 3,
  baseDelayMs: 400,
})
```

## Options

<ParamField path="platform" type="Platform" default="common-gen5">
  Default platform for every request. A method input can override it.
</ParamField>

<ParamField path="timeoutMs" type="number" default="15000">
  Positive, finite timeout used by the built-in Impit transport.
</ParamField>

<ParamField path="maxAttempts" type="number" default="3">
  Total attempts for a request, including the first one. Must be an integer from
  `1` through `5`.
</ParamField>

<ParamField path="baseDelayMs" type="number" default="400">
  Non-negative, finite initial retry delay. Each retry doubles the previous
  backoff delay.
</ParamField>

<ParamField path="httpMode" type="'default' | 'strict'" default="default">
  In `strict` mode, reject every HTTP 403 immediately, even when the payload
  validates. The default mode accepts a valid 403 payload and retries an invalid
  one within `maxAttempts`. See [Errors and retries](/docs/guides/errors-and-retries).
</ParamField>

<ParamField path="transport" type="ProClubsTransport">
  Optional request function for tests or custom Node.js runtimes.
</ParamField>

<ParamField path="cache" type="boolean | ProClubsCacheOptions" default="false">
  Set to `true` for a 60-second memory cache, or provide `ttlMs` and
  `maxEntries` for advanced control. See [Cache and observability](/docs/guides/cache-and-observability).
</ParamField>

<ParamField path="onEvent" type="ProClubsEventHandler">
  Optional local hook for cache, retry, request, and error events. It never
  enables telemetry.
</ParamField>

Invalid options throw `ProClubsValidationError` synchronously in the constructor.

## Per-request platform

Every method that accepts a platform uses this precedence:

1. the platform supplied in the method input;
2. the client default;
3. `common-gen5`.

```ts theme={null}
const proclubs = new ProClubsClient({ platform: 'common-gen5' })

const switchClub = await proclubs.clubs.get({
  clubId: '12345',
  platform: 'nx',
})
```

### Deprecated platforms

`common-gen4` is deprecated. Since the FC 27 switchover, EA rejects it with
HTTP 400 on every endpoint, and the EA rankings page only lists `common-gen5`
and `nx` (last checked on 2026-09-30).

The value stays in `PLATFORMS` and in the `Platform` type so existing code keeps
compiling. A request that uses it still reaches EA and fails with
`ProClubsHttpError` (`status: 400`). Each client emits one Node.js
`DeprecationWarning` with the code `PROCLUBS_DEP001` the first time it sends
such a request.

```ts theme={null}
import { DEPRECATED_PLATFORMS, PLATFORMS } from 'proclubs-sdk'

const activePlatforms = PLATFORMS.filter(
  (platform) => !DEPRECATED_PLATFORMS.includes(platform),
)
// ['common-gen5', 'nx']
```

## Custom transport

The default transport uses Impit with a Chrome network profile, so requests look
like the ones the EA website sends. EA's edge refuses or stalls some other
clients: on 2026-09-30, curl got an HTTP/2 stream reset, and developers report
intermittent 403s and timeouts from servers.

You can inject a compatible transport at the HTTP boundary instead, for example
plain `fetch`.

```ts theme={null}
import {
  ProClubsClient,
  type ProClubsTransport,
} from 'proclubs-sdk'

const transport: ProClubsTransport = (url, init) => fetch(url, init)
const proclubs = new ProClubsClient({ transport })
```

<Warning>
  `timeoutMs` configures only the built-in transport. A custom transport must
  implement its own timeout behavior and forward the supplied abort signal.
</Warning>

The transport receives a `URL`, a GET request initializer, and an optional
`AbortSignal`. Its response must expose `status`, `statusText`, `ok`, `headers`,
and an asynchronous `text()` method.


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