{"record":{"id":"719db8ea88ee6199","repo":"louislam/uptime-kuma","slug":"steam-api-key-not-found","errorCode":null,"errorMessage":"Steam API Key not found","messagePattern":"Steam API Key not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/steam.js","lineNumber":45,"sourceCode":"     */\n    constructor(options = {}) {\n        super();\n\n        this.steamApiClient = options.steamApiClient || axios;\n        this.lookup = options.lookup || dns.lookup;\n        this.getSteamAPIKey = options.getSteamAPIKey || (() => Settings.get(\"steamAPIKey\"));\n        this.ping = options.ping || ping;\n    }\n\n    /**\n     * @inheritdoc\n     */\n    async check(monitor, heartbeat) {\n        const steamApiUrl = \"https://api.steampowered.com/IGameServersService/GetServerList/v1/\";\n        const steamAPIKey = await this.getSteamAPIKey();\n\n        if (!steamAPIKey) {\n            throw new Error(\"Steam API Key not found\");\n        }\n\n        const filter = await this.buildServerFilter(monitor.hostname, monitor.port);\n\n        let res = await this.steamApiClient.get(steamApiUrl, {\n            timeout: monitor.timeout * 1000,\n            headers: {\n                Accept: \"*/*\",\n            },\n            httpsAgent: new https.Agent({\n                maxCachedSessions: 0, // Use Custom agent to disable session reuse (https://github.com/nodejs/node/issues/3940)\n                rejectUnauthorized: !monitor.getIgnoreTls(),\n                secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT,\n            }),\n            httpAgent: new http.Agent({\n                maxCachedSessions: 0,\n            }),\n            maxRedirects: monitor.maxredirects,","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/steam.js#L27-L63","documentation":"Thrown when this.getSteamAPIKey() resolves to a falsy value. The default provider reads Settings.get('steamAPIKey'); a missing key means the Uptime-Kuma instance has never stored a Steam Web API key, so the request to IGameServersService/GetServerList cannot be authenticated and the check aborts before any network call.","triggerScenarios":"Triggered at the start of SteamMonitorType.check() when the 'steamAPIKey' settings row is absent, empty, or was cleared. The guard prevents sending an unauthenticated request that Steam would reject with HTTP 403/400.","commonSituations":"Fresh install where the operator never entered a Steam Web API key in Settings; the key was registered against a different Uptime-Kuma instance; Steam revoked/expired the key; or a test environment where getSteamAPIKey was stubbed to return undefined.","solutions":["Obtain a Steam Web API key from Steamworks and enter it in Uptime-Kuma Settings → Steam API Key.","Restart/re-trigger the monitor after saving the key so Settings.get('steamAPIKey') returns the new value.","If the key was rejected by Steam (403), generate a new one and replace it.","In tests, inject options.getSteamAPIKey so it resolves to a non-empty string."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"async function requireSteamKey(getKey) {\n  const key = await getKey();\n  if (!key || typeof key !== \"string\") throw new Error(\"Steam API Key not found\");\n  return key;\n}","typeGuard":"function hasSteamKey(v) { return typeof v === \"string\" && v.trim().length > 0; }","tryCatchPattern":"const key = await this.getSteamAPIKey();\nif (!hasSteamKey(key)) { heartbeat.status = DOWN; heartbeat.msg = \"Steam API key missing\"; return; }","preventionTips":["Store the Steam Web API key in Settings before creating steam monitors.","Inject a non-empty getKey stub in tests.","Surface a clear setup banner in the UI when the key is absent."],"tags":["steam","api-key","configuration","authentication"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}