30 lines · 650 B · TypeScript
RawDownload
/** * API key management utilities */ let runtimeApiKey = ""; /** * Get the API key from environment variables or in-memory runtime state. */export function getApiKey(): string {  // Prefer env var if available (build-time or runtime)  const envKey = process.env.NEXT_PUBLIC_VLLM_STUDIO_API_KEY || process.env.VLLM_STUDIO_API_KEY;  if (envKey) return envKey;   return runtimeApiKey;} /** * Save API key only for the current browser runtime. */export function setApiKey(key: string): void {  runtimeApiKey = key.trim();} /** * Remove the in-memory runtime API key. */export function clearApiKey(): void {  runtimeApiKey = "";}

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