MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getUserCredentials

Function getUserCredentials

sdk/src/credentials.ts:69–83  ·  view source on GitHub ↗
(clientEnv: ClientEnv = env)

Source from the content-addressed store, hash-verified

67}
68
69export const getUserCredentials = (clientEnv: ClientEnv = env): User | null => {
70 const credentialsPath = getCredentialsPath(clientEnv)
71 if (!fs.existsSync(credentialsPath)) {
72 return null
73 }
74
75 try {
76 const credentialsFile = fs.readFileSync(credentialsPath, 'utf8')
77 const user = userFromJson(credentialsFile)
78 return user || null
79 } catch (error) {
80 console.error('Error reading credentials', error)
81 return null
82 }
83}
84
85/**
86 * ChatGPT OAuth credentials stored in the credentials file.

Callers 6

testSdkFunction · 0.90
mainFunction · 0.90
generateEvalFileV2Function · 0.90
runBuffBenchFunction · 0.90
getApiKeyOrSkipFunction · 0.90

Calls 2

getCredentialsPathFunction · 0.70
userFromJsonFunction · 0.70

Tested by 1

getApiKeyOrSkipFunction · 0.72