Skip to content

createAPIClient

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/web/src/lib/api-client.ts

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

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

Returns: APIClient

Was this page helpful?

Download as PDF