MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getInstallationId

Function getInstallationId

packages/core/src/utils/user_id.ts:41–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 * @returns A UUID string for the user.
40 */
41export function getInstallationId(): string {
42 try {
43 ensureAnusDirExists();
44 let installationId = readInstallationIdFromFile();
45
46 if (!installationId) {
47 installationId = randomUUID();
48 writeInstallationIdToFile(installationId);
49 }
50
51 return installationId;
52 } catch (error) {
53 console.error(
54 'Error accessing installation ID file, generating ephemeral ID:',
55 error,
56 );
57 return '123456789';
58 }
59}

Callers 3

user_id.test.tsFile · 0.85
createLogEventMethod · 0.85
createContentGeneratorFunction · 0.85

Calls 3

ensureAnusDirExistsFunction · 0.85

Tested by

no test coverage detected