Skip to content

Commit

Permalink
fix: update get-game-hashes to include js client call (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshraphael authored Jan 8, 2025
1 parent 1986957 commit 4b5812f
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion docs/v1/get-game-hashes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,22 @@ This data can be found on the Supported Game Files page, for example, [Sonic the

::: code-group

```Kotlin
```ts [NodeJS]
import { buildAuthorization, getGameHashes } from "@retroachievements/api";

// First, build your authorization object.
const username = "<your username on RA>";
const webApiKey = "<your web API key>";

const authorization = buildAuthorization({ username, webApiKey });

// Then, make the API call.
const game = await getGameHashes(authorization, {
gameId: 14402,
});
```

```kotlin [Kotlin]
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api

Expand Down Expand Up @@ -75,11 +90,31 @@ if (response is NetworkResponse.Success) {
}
```

```json [NodeJS]
{
"results": [
{
"md5": "1b1d9ac862c387367e904036114c4825",
"name": "Sonic The Hedgehog (USA, Europe) (Ru) (NewGame).md",
"labels": ["nointro", "rapatches"],
"patchUrl": "https://github.com/RetroAchievements/RAPatches/raw/main/MD/Translation/Russian/1-Sonic1-Russian.zip"
},
{
"md5": "1bc674be034e43c96b86487ac69d9293",
"name": "Sonic The Hedgehog (USA, Europe).md",
"labels": ["nointro"],
"patchUrl": null
}
]
}
```

:::

## Source

| Repo | URL |
| :--------- | :------------------------------------------------------------------------------------------------------------------- |
| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetGameHashes.php |
| api-js | https://github.com/RetroAchievements/api-js/blob/main/src/game/getGameHashes.ts |
| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |

0 comments on commit 4b5812f

Please sign in to comment.