MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveMyUserId

Function resolveMyUserId

apps/sim/connectors/x/x.ts:165–175  ·  view source on GitHub ↗

* Resolves the authenticated user's numeric ID via GET /2/users/me.

(
  accessToken: string,
  retryOptions?: Parameters<typeof fetchWithRetry>[2]
)

Source from the content-addressed store, hash-verified

163 * Resolves the authenticated user's numeric ID via GET /2/users/me.
164 */
165async function resolveMyUserId(
166 accessToken: string,
167 retryOptions?: Parameters<typeof fetchWithRetry>[2]
168): Promise<string> {
169 const data = (await xApiGet('/users/me', accessToken, undefined, retryOptions)) as {
170 data?: { id?: string }
171 }
172 const id = data.data?.id
173 if (!id) throw new Error('Failed to resolve authenticated user ID')
174 return id
175}
176
177/**
178 * Resolves a public username to its numeric user ID via

Callers 1

x.tsFile · 0.85

Calls 1

xApiGetFunction · 0.85

Tested by

no test coverage detected