Skip to Content
This project is in active development. Features and behaviors may change without notice.

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

OptionTypeDescription
usernamestringThe Scratch username to fetch information for

Return Value

  • Promise<APIResult<userInfoProps>>: On success, the profile information is returned in the data field. 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