MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getApiKey

Function getApiKey

sdk/e2e/utils/get-api-key.ts:9–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 * Defaults to a mock key for deterministic local runs.
8 */
9export function getApiKey(): string {
10 if (shouldRunLiveE2e) {
11 const apiKey = process.env.CODEBUFF_API_KEY
12 if (!apiKey) {
13 throw new Error(
14 'CODEBUFF_API_KEY environment variable is required for live e2e tests. ' +
15 'Get your API key at https://www.codebuff.com/api-keys',
16 )
17 }
18 return apiKey
19 }
20
21 setupE2eMocks()
22 process.env.CODEBUFF_API_KEY = E2E_MOCK_API_KEY
23 return E2E_MOCK_API_KEY
24}
25
26/**
27 * E2E tests should always run; use mock mode when not opted-in.

Calls 1

setupE2eMocksFunction · 0.90

Tested by

no test coverage detected