{"record":{"id":"1f51000c889dcdb1","repo":"DIYgod/RSSHub","slug":"missing-access-token-for-misskey-api-please-set","errorCode":null,"errorMessage":"Missing access token for Misskey API. Please set `MISSKEY_ACCESS_TOKEN` environment variable.","messagePattern":"Missing access token for Misskey API\\. Please set `MISSKEY_ACCESS_TOKEN` environment variable\\.","errorType":"exception","errorClass":"ConfigNotFoundError","httpStatus":503,"severity":"error","filePath":"lib/routes/misskey/home-timeline.ts","lineNumber":69,"sourceCode":"        supportScihub: false,\n    },\n    radar: [\n        {\n            source: ['misskey.io'],\n        },\n    ],\n    name: 'Home Timeline',\n    maintainers: ['HanaokaYuzu'],\n    handler,\n    description: `::: warning\nThis route is only available for self-hosted instances.\n:::`,\n};\n\nasync function handler(ctx) {\n    const access_token = config.misskey.accessToken;\n    if (!access_token) {\n        throw new ConfigNotFoundError('Missing access token for Misskey API. Please set `MISSKEY_ACCESS_TOKEN` environment variable.');\n    }\n\n    const site = ctx.req.param('site');\n    if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {\n        throw new ConfigNotFoundError(`This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);\n    }\n\n    // docs on: https://misskey.io/api-doc#tag/notes/operation/notes___timeline\n    const url = `https://${site}/api/notes/timeline`;\n    const routeParams = querystring.parse(ctx.req.param('routeParams'));\n    const response = await got({\n        method: 'post',\n        url,\n        headers: {\n            Authorization: `Bearer ${access_token}`,\n        },\n        json: {\n            limit: Number(routeParams.limit ?? 10),","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/DIYgod/RSSHub/blob/bed535e0879dc71c5aff6f1e7bd1ac21ede40115/lib/routes/misskey/home-timeline.ts#L51-L87","documentation":"Thrown as ConfigNotFoundError by the Misskey 'home timeline' route when config.misskey.accessToken is falsy. This route is self-host only — it returns the authenticated user's personal home timeline via POST https://<site>/api/notes/timeline, which requires a user access token sent as Authorization: Bearer <token>. No token means the feed is disabled.","triggerScenarios":"Any request to /misskey/home-timeline/:site while MISSKEY_ACCESS_TOKEN is unset. The token check runs before the host allow-list check, so even an allowed site throws here if the token is missing.","commonSituations":"A self-hoster who enabled the route's instance but never generated a Misskey access token; MISSKEY_ACCESS_TOKEN set under a different name/case; the token was committed-then-rotated and the env wasn't updated.","solutions":["Generate a Misskey access token (Settings → API → Generate access token, with the 'read' scope on notes/timeline) and set it as MISSKEY_ACCESS_TOKEN in RSSHub's environment.","Restart RSSHub and confirm the var is present in the process environment.","Verify the token works directly: `curl -H \"Authorization: Bearer <token>\" -H 'Content-Type: application/json' -d '{\"limit\":10}' https://<site>/api/notes/timeline`.","Ensure :site is on the allow-list or ALLOW_USER_SUPPLY_UNSAFE_DOMAIN=true, otherwise you will next hit error 387."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const access_token = config.misskey.accessToken;\nif (!access_token) {\n    throw new ConfigNotFoundError('Set MISSKEY_ACCESS_TOKEN (a Misskey API token with read scope) to enable the home timeline.');\n}","typeGuard":"function hasMisskeyToken(c: any): boolean {\n    return typeof c?.misskey?.accessToken === 'string' && c.misskey.accessToken.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Generate the token with the minimal 'read' scope and store it in a secret manager.","Run a deploy-time check: curl the /api/notes/timeline endpoint with the token.","Document that this route is self-host only and token-gated."],"tags":["missing-config","authentication","access-token","misskey","self-hosted"],"backgroundTag":null,"analyzedSha":"bed535e0879dc71c5aff6f1e7bd1ac21ede40115","analyzedAt":"2026-08-12T19:29:35.364Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}