MCPcopy Index your code
hub / github.com/upstash/context7 / getAuthHeaders

Function getAuthHeaders

packages/cli/src/utils/api.ts:267–281  ·  view source on GitHub ↗
(accessToken?: string)

Source from the content-addressed store, hash-verified

265}
266
267function getAuthHeaders(accessToken?: string): Record<string, string> {
268 const headers: Record<string, string> = {
269 "X-Context7-Source": "cli",
270 "X-Context7-Client-IDE": "ctx7-cli",
271 "X-Context7-Client-Version": VERSION,
272 "X-Context7-Transport": "cli",
273 };
274 const apiKey = process.env.CONTEXT7_API_KEY;
275 if (apiKey) {
276 headers["Authorization"] = `Bearer ${apiKey}`;
277 } else if (accessToken) {
278 headers["Authorization"] = `Bearer ${accessToken}`;
279 }
280 return headers;
281}
282
283export async function resolveLibrary(
284 libraryName: string,

Callers 2

resolveLibraryFunction · 0.85
getLibraryContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected