{"record":{"id":"113f3c097ec0cf60","repo":"DIYgod/RSSHub","slug":"github-notification-rss-is-disabled-due-to-the-lac","errorCode":null,"errorMessage":"GitHub notification RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>","messagePattern":"GitHub notification RSS is disabled due to the lack of <a href=\"https://docs\\.rsshub\\.app/deploy/config#route-specific-configurations\">relevant config</a>","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":null,"severity":"error","filePath":"lib/routes/github/notifications.ts","lineNumber":34,"sourceCode":"                name: 'GITHUB_ACCESS_TOKEN',\n                description: '',\n            },\n        ],\n    },\n    radar: [\n        {\n            source: ['github.com/notifications'],\n        },\n    ],\n    name: 'Notifications',\n    maintainers: ['zhzy0077'],\n    handler,\n    url: 'github.com/notifications',\n};\n\nasync function handler(ctx) {\n    if (!config.github || !config.github.access_token) {\n        throw new ConfigNotFoundError('GitHub notification RSS is disabled due to the lack of <a href=\"https://docs.rsshub.app/deploy/config#route-specific-configurations\">relevant config</a>');\n    }\n    const headers = {\n        Accept: 'application/vnd.github.v3+json',\n        Authorization: `Bearer ${config.github.access_token}`,\n        'X-GitHub-Api-Version': '2022-11-28',\n    };\n\n    const response = await ofetch.raw(`${apiUrl}/notifications`, {\n        headers,\n    });\n    const notifications = response._data;\n\n    const items = notifications.map((item) => {\n        let originUrl = item.subject.url ? item.subject.url.replace('https://api.github.com/repos/', 'https://github.com/') : 'https://github.com/notifications';\n        if (originUrl.includes('/releases/')) {\n            originUrl = originUrl.replace(/\\/releases\\/\\d+$/, '/releases');\n        } else if (originUrl.includes('/pulls/')) {\n            originUrl = originUrl.replace(/\\/pulls\\/(\\d+)$/, '/pull/$1');","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/github/notifications.ts#L16-L52","documentation":"Thrown as a ConfigNotFoundError by the GitHub Notifications route when config.github.access_token is not set. Unlike the other GitHub routes which use GraphQL, this route uses the REST API (api.github.com/notifications via ofetch.raw) with Bearer token authentication. The notifications endpoint is inherently user-scoped and requires a token with the 'notifications' scope.","triggerScenarios":"Any request to /github/notifications when GITHUB_ACCESS_TOKEN is not set. Even if set, the token must have the 'notifications' scope or the downstream API call will return 401/403. The guard fires before any network call.","commonSituations":"GITHUB_ACCESS_TOKEN not set at all; token exists but lacks the 'notifications' scope (classic PAT needs 'notifications' checked, fine-grained PAT needs 'Notifications' read access); the user expects public data but notifications are inherently private.","solutions":["Set GITHUB_ACCESS_TOKEN to a personal access token that has the 'notifications' scope enabled","For classic PATs: check 'notifications' under personal access token settings when creating the token","For fine-grained PATs: grant 'Notifications' -> Read access under account permissions","Restart RSSHub after updating the token"],"exampleFix":"// Configuration fix:\n// 1. Create a GitHub PAT with 'notifications' scope\n// 2. Set GITHUB_ACCESS_TOKEN=ghp_xxxx\n// 3. Restart RSSHub","handlingStrategy":"validation","validationCode":"// Verify token has notifications scope before the route handler runs\nif (!config.github?.access_token) {\n    throw new ConfigNotFoundError('GITHUB_ACCESS_TOKEN is required for notifications. Token must have notifications scope.');\n}","typeGuard":"function hasGitHubToken(cfg: typeof config): cfg is typeof config & { github: { access_token: string } } {\n    return !!cfg.github?.access_token;\n}","tryCatchPattern":null,"preventionTips":["Create a classic PAT with 'notifications' scope checked","For fine-grained PATs, grant 'Notifications' read access","Verify the token works: curl -H 'Authorization: token TOKEN' https://api.github.com/notifications","Set GITHUB_ACCESS_TOKEN and restart RSSHub"],"tags":["config","github","authentication","missing-config","config-not-found","notifications"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}