MCPcopy
hub / github.com/upstash/context7 / fetchWhoami

Function fetchWhoami

packages/cli/src/commands/auth.ts:254–266  ·  view source on GitHub ↗
(accessToken: string)

Source from the content-addressed store, hash-verified

252}
253
254async function fetchWhoami(accessToken: string): Promise<WhoamiResponse> {
255 const response = await fetch(`${getBaseUrl()}/api/dashboard/whoami`, {
256 headers: {
257 Authorization: `Bearer ${accessToken}`,
258 },
259 });
260
261 if (!response.ok) {
262 throw new Error("Failed to fetch user info");
263 }
264
265 return (await response.json()) as WhoamiResponse;
266}

Callers 2

announceIdentityFunction · 0.85
whoamiCommandFunction · 0.85

Calls 1

getBaseUrlFunction · 0.85

Tested by

no test coverage detected