MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getOrCreateUserID

Function getOrCreateUserID

src/utils/config.ts:1777–1786  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1775}
1776
1777export function getOrCreateUserID(): string {
1778 const config = getGlobalConfig()
1779 if (config.userID) {
1780 return config.userID
1781 }
1782
1783 const userID = randomBytes(32).toString('hex')
1784 saveGlobalConfig(current => ({ ...current, userID }))
1785 return userID
1786}
1787
1788export function recordFirstStartTime(): void {
1789 const config = getGlobalConfig()

Callers 3

getTelemetryAttributesFunction · 0.85
user.tsFile · 0.85
getAPIMetadataFunction · 0.85

Calls 3

getGlobalConfigFunction · 0.85
saveGlobalConfigFunction · 0.85
toStringMethod · 0.65

Tested by

no test coverage detected