13 lines · 548 B · TypeScript
RawDownload
/** * Default API client singleton for the Local Studio controller. */import { createApiClient } from "./create-api-client";import { resolveApiServerBaseUrl } from "./connection"; // For client-side calls, use the proxy which handles authentication// The proxy adds the API key server-side, avoiding CORS and auth issuesconst isClient = typeof window !== "undefined";const clientBaseUrl = isClient ? "/api/proxy" : resolveApiServerBaseUrl(); const api = createApiClient({ baseUrl: clientBaseUrl, useProxy: isClient });export default api;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t