MCPcopy Create free account
hub / github.com/TanStack/ai / resolveGrokAcpAuthMethod

Function resolveGrokAcpAuthMethod

packages/ai-grok-build/src/auth.ts:9–18  ·  view source on GitHub ↗
(
  env?: Record<string, string | undefined>,
)

Source from the content-addressed store, hash-verified

7 * Sandboxed runs inject `XAI_API_KEY`; local runs may use `grok login` instead.
8 */
9export function resolveGrokAcpAuthMethod(
10 env?: Record<string, string | undefined>,
11): GrokBuildAcpAuthMethod {
12 const key =
13 env?.XAI_API_KEY ??
14 env?.GROK_API_KEY ??
15 process.env.XAI_API_KEY ??
16 process.env.GROK_API_KEY
17 return key ? 'xai.api_key' : 'grok.com'
18}

Callers 2

chatStreamAcpMethod · 0.90
acp.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected