MCPcopy Create free account
hub / github.com/Noumena-Network/code / fetchRemoteCredentials

Function fetchRemoteCredentials

src/bridge/remoteBridgeCore.ts:917–934  ·  view source on GitHub ↗
(
  sessionId: string,
  baseUrl: string,
  accessToken: string,
  timeoutMs: number,
)

Source from the content-addressed store, hash-verified

915// injects the trusted-device token (both are env/GrowthBook reads that the
916// SDK-facing codeSessionApi.ts export must stay free of).
917export async function fetchRemoteCredentials(
918 sessionId: string,
919 baseUrl: string,
920 accessToken: string,
921 timeoutMs: number,
922): Promise<RemoteCredentials | null> {
923 const creds = await fetchRemoteCredentialsRaw(
924 sessionId,
925 baseUrl,
926 accessToken,
927 timeoutMs,
928 getTrustedDeviceToken(),
929 )
930 if (!creds) return null
931 return getBridgeBaseUrlOverride()
932 ? { ...creds, api_base_url: baseUrl }
933 : creds
934}
935
936type ArchiveStatus = number | 'timeout' | 'error' | 'no_token'
937

Callers 2

initEnvLessBridgeCoreFunction · 0.70
recoverFromAuthFailureFunction · 0.70

Calls 2

getTrustedDeviceTokenFunction · 0.85
getBridgeBaseUrlOverrideFunction · 0.85

Tested by

no test coverage detected