MCPcopy
hub / github.com/codeaashu/claude-code / prepareApiRequest

Function prepareApiRequest

src/utils/teleport/api.ts:181–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179 * @returns Object containing access token and organization UUID
180 */
181export async function prepareApiRequest(): Promise<{
182 accessToken: string
183 orgUUID: string
184}> {
185 const accessToken = getClaudeAIOAuthTokens()?.accessToken
186 if (accessToken === undefined) {
187 throw new Error(
188 'Claude Code web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.',
189 )
190 }
191
192 const orgUUID = await getOrganizationUUID()
193 if (!orgUUID) {
194 throw new Error('Unable to get organization UUID')
195 }
196
197 return { accessToken, orgUUID }
198}
199
200/**
201 * Fetches code sessions from the new Sessions API (/v1/sessions)

Callers 15

runFunction · 0.85
fetchSessionFunction · 0.85
sendEventToRemoteSessionFunction · 0.85
updateSessionTitleFunction · 0.85
importGithubTokenFunction · 0.85
createDefaultEnvironmentFunction · 0.85
isSignedInFunction · 0.85
createAdminRequestFunction · 0.85
getMyAdminRequestsFunction · 0.85
fetchReferralEligibilityFunction · 0.85

Calls 1

getOrganizationUUIDFunction · 0.85

Tested by

no test coverage detected