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

Function getGitHubHeaders

examples/ts-code-mode-web/src/lib/tools/github-tools.ts:7–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const FETCH_TIMEOUT = 15000 // 15 second timeout per request
6
7function getGitHubHeaders(): HeadersInit {
8 const token = process.env.GITHUB_TOKEN
9 if (!token) {
10 throw new Error('GITHUB_TOKEN environment variable is required')
11 }
12 return {
13 Authorization: `Bearer ${token}`,
14 Accept: 'application/vnd.github+json',
15 'X-GitHub-Api-Version': '2022-11-28',
16 }
17}
18
19/**
20 * Fetch with timeout - prevents hanging on network issues

Callers 1

github-tools.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected