diff --git a/projects/common/src/service/service.ts b/projects/common/src/service/service.ts index 1a2f24f..e6890db 100644 --- a/projects/common/src/service/service.ts +++ b/projects/common/src/service/service.ts @@ -39,7 +39,11 @@ export default class Service { */ public async fetch(url: string): Promise { try { - return await ky.get(this.buildRequestUrl(!isServer(), url)).json(); + const response = await ky.get(this.buildRequestUrl(!isServer(), url)); + if (response.headers.has("X-RateLimit-Remaining")) { + this.log(`Rate limit remaining: ${response.headers.get("X-RateLimit-Remaining")}`); + } + return response.json(); } catch (error) { return undefined; }