Skip to content

Commit 7b667f1

Browse files
committed
docs: add getUsersFollowingMe JS function example
1 parent a371142 commit 7b667f1

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

docs/v1/get-users-following-me.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,28 @@ The user's Followers Users List page looks like:
3030

3131
::: code-group
3232

33+
```ts [NodeJS]
34+
import { buildAuthorization, getUsersFollowingMe } from "@retroachievements/api";
35+
36+
// First, build your authorization object.
37+
const username = "<your username on RA>";
38+
const webApiKey = "<your web API key>";
39+
40+
const authorization = buildAuthorization({ username, webApiKey });
41+
42+
// Then, make the API call.
43+
const usersFollowingMe = await getUsersFollowingMe(authorization);
44+
45+
// Note: a payload object can be specified as a second argument to alter
46+
// the number of users returned and/or the starting offset.
47+
//
48+
// Example:
49+
// const anotherSetOfUsersFollowingMe = await getUsersFollowingMe(authorization, {
50+
// offset: 60,
51+
// count: 20
52+
// });
53+
```
54+
3355
```Kotlin
3456
val credentials = RetroCredentials("<username>", "<web api key>")
3557
val api: RetroInterface = RetroClient(credentials).api
@@ -72,11 +94,29 @@ if (response is NetworkResponse.Success) {
7294
}
7395
```
7496

97+
```json [NodeJS]
98+
{
99+
"count": 20,
100+
"total": 120,
101+
"results": [
102+
{
103+
"user": "zuliman92",
104+
"ulid": "00003EMFWR7XB8SDPEHB3K56ZQ",
105+
"points": 1882,
106+
"pointsSoftcore": 258,
107+
"amIFollowing": true
108+
}
109+
// ...
110+
]
111+
}
112+
```
113+
75114
:::
76115

77116
## Source
78117

79118
| Repo | URL |
80119
| :--------- | :------------------------------------------------------------------------------------------------------------------- |
81120
| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetUsersFollowingMe.php |
121+
| api-js | https://github.com/RetroAchievements/api-js/blob/main/src/user/getUsersFollowingMe.ts |
82122
| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |

0 commit comments

Comments
 (0)