-
|
Hi all, I’m working on a Node.js project using @retroachievements/api@2.4.0 with TypeScript (nodenext, Node.js 22) and noticed that the leaderboard endpoints (getLeaderboardEntries, getGameLeaderboards, getUserGameLeaderboards) are not implemented in the JavaScript library, despite being documented and available in the RAWeb API. I’d like to clarify if this is intentional, a known limitation, or an oversight, and share a workaround for others who might encounter this. Context The RAWeb API includes three leaderboard endpoints, added in RAWeb PR #2564 (merged July 31, 2024, release 6.10.0):
The main page (https://api-docs.retroachievements.org/) states that @retroachievements/api aligns 1:1 with the RAWeb API, suggesting these endpoints should be supported. However:
Attempting to import these (e.g., import { getLeaderboardEntries } from '@retroachievements/api/game') fails at compile-time unless a custom .d.ts declares them, then causes TypeError: getLeaderboardEntries is not a function at runtime. Workaround I implemented direct API calls using node-fetch to access the RAWeb endpoints, which work reliably in a Firebase Cloud Functions project. Example: `import { Request, Response } from 'express'; async function fetchGameLeaderboards(req: Request, res: Response): Promise { Similar functions for fetchLeaderboardEntries and fetchUserGameLeaderboards work by calling API_GetLeaderboardEntries.php and API_GetUserGameLeaderboards.php. Questions
Additional Notes
I’d appreciate any clarification from maintainers (e.g., @wescopeland) or the community on the library’s scope and plans for these endpoints. Happy to provide more details or test future updates! References
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
From my understanding, the api-js library needs to be manually updated to reflect changes made in RAWeb API. Being open source, anyone is able to make a PR and solve the issues :) I can't speak for when they are planned to be added to api-js. |
Beta Was this translation helpful? Give feedback.
From my understanding, the api-js library needs to be manually updated to reflect changes made in RAWeb API.
The following issues have been raised, so they are planned:
#104
#112
#111
#113
#115
Being open source, anyone is able to make a PR and solve the issues :) I can't speak for when they are planned to be added to api-js.