getUser
Type: getUser(username: string): Promise<APIResult<userInfoProps>>
getUser() retrieves profile information (such as ID, avatar, join date, etc.) for the specified Scratch username via the Scratch API.
TypeScript
const = .();
const = await .("griffpatch");Parameters
| Option | Type | Description |
|---|---|---|
| username | string | The Scratch username to fetch information for |
Return Value
Promise<APIResult<userInfoProps>>: On success, the profile information is returned in thedatafield. On failure, an error response is returned.
Example Usage
TypeScript
const = await .().("scratchteam");
if (.) {
.(.); // Scratch user profile information
} else {
.(.);
}Notes
- If the specified user does not exist or the Scratch API does not respond, the result will have
success: false. - The returned data depends on the Scratch API specification.
Last updated on