Skip to content

Commit 3c10ffc

Browse files
committed
docs: add getUsersFollowingMe JS function example
1 parent a371142 commit 3c10ffc

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

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

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

3131
::: code-group
3232

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

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

77119
## Source
78120

79121
| Repo | URL |
80122
| :--------- | :------------------------------------------------------------------------------------------------------------------- |
81123
| RAWeb | https://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetUsersFollowingMe.php |
124+
| api-js | https://github.com/RetroAchievements/api-js/blob/main/src/user/getUsersFollowingMe.ts |
82125
| api-kotlin | https://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt |

0 commit comments

Comments
 (0)