MCPcopy Index your code
hub / github.com/MatterAIOrg/OrbCode / fetchProfile

Function fetchProfile

src/auth/auth.ts:144–161  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

142}
143
144export async function fetchProfile(token: string): Promise<ProfileData> {
145 const url = getUrlFromToken(
146 "https://api.matterai.so/axoncode/profile",
147 token,
148 );
149 const response = await fetch(url, {
150 headers: {
151 Authorization: `Bearer ${token}`,
152 "Content-Type": "application/json",
153 },
154 });
155 if (!response.ok) {
156 throw new Error(
157 `Profile request failed (${response.status}). Your token may be invalid or expired.`,
158 );
159 }
160 return (await response.json()) as ProfileData;
161}
162
163/**
164 * Extract a clean title from potentially malformed input: a plain string,

Callers 2

verifyTokenFunction · 0.85
AppFunction · 0.85

Calls 1

getUrlFromTokenFunction · 0.85

Tested by

no test coverage detected