{"record":{"id":"bd544e836a0db0c1","repo":"coleam00/Archon","slug":"github-app-client-id-is-required-for-the-github-de","errorCode":null,"errorMessage":"GITHUB_APP_CLIENT_ID is required for the GitHub device flow. Find it on the GitHub App settings page (the client id, starts with \"Iv1.\" or \"Iv23\").","messagePattern":"GITHUB_APP_CLIENT_ID is required for the GitHub device flow\\. Find it on the GitHub App settings page \\(the client id, starts with \"Iv1\\.\" or \"Iv23\"\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/github-auth/config.ts","lineNumber":37,"sourceCode":"}\n\n/**\n * Per-user GitHub attribution is active only when the GitHub App is configured\n * AND a token-encryption key is present.\n */\nexport function isPerUserGitHubEnabled(env: NodeJS.ProcessEnv = process.env): boolean {\n  return Boolean(env.GITHUB_APP_ID && env.TOKEN_ENCRYPTION_KEY);\n}\n\n/**\n * Resolve the GitHub App client id used for the device flow. Throws if missing\n * so the connect surfaces fail fast with an actionable message rather than\n * issuing a malformed device-code request.\n */\nexport function loadDeviceFlowConfig(env: NodeJS.ProcessEnv = process.env): DeviceFlowConfig {\n  const clientId = env.GITHUB_APP_CLIENT_ID?.trim();\n  if (!clientId) {\n    throw new Error(\n      'GITHUB_APP_CLIENT_ID is required for the GitHub device flow. ' +\n        'Find it on the GitHub App settings page (the client id, starts with \"Iv1.\" or \"Iv23\").'\n    );\n  }\n  return { clientId };\n}\n\n/**\n * Fail fast at server boot: when per-user GitHub is enabled, the encryption key\n * must be present and well-formed. `getEncryptionKey()` throws otherwise, so a\n * misconfigured deployment never silently stores unencryptable tokens.\n */\nexport function assertEncryptionKeyAtBoot(env: NodeJS.ProcessEnv = process.env): void {\n  if (isPerUserGitHubEnabled(env)) {\n    getEncryptionKey(env);\n  }\n}\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/github-auth/config.ts#L19-L55","documentation":"Error \"GITHUB_APP_CLIENT_ID is required for the GitHub device flow. Find it on the GitHub App settings page (the client id, starts with \"Iv1.\" or \"Iv23\").\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/core/src/github-auth/config.ts:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}