# createAPIClient

**Kind:** Function

**Source:** [`atloria-monorepo/apps/web/src/lib/api-client.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/web/src/lib/api-client.ts#L176)

Create an API client for the Atloria application

This client makes HTTP requests to the backend API

## Signature

```ts
function createAPIClient(config: {
  apiUrl: string;
  getToken?: () => string | null;
  /** True while NextAuth is still resolving the session — the fetcher waits instead of firing unauthenticated. */
  isSessionLoading?: () => boolean;
}): APIClient
```

## Parameters

| Name | Type |
|---|---|
| `config` | `{
  apiUrl: string;
  getToken?: () => string | null;
  /** True while NextAuth is still resolving the session — the fetcher waits instead of firing unauthenticated. */
  isSessionLoading?: () => boolean;
}` |

**Returns:** `APIClient`
