UNPKG

@retroachievements/api

Version:

A well-tested library that lets you get achievement, user, and game data from RetroAchievements.

33 lines (32 loc) 1.05 kB
import type { AuthObject } from "../utils/public"; import type { UserSummary } from "./models"; /** * A call to this function will retrieve summary information about * a given user, targeted by username. * * @param authorization An object containing your username and webApiKey. * This can be constructed with `buildAuthorization()`. * * @param payload.username The user for which to retrieve the summary for. * * @param payload.recentGamesCount Optional. The number of recent games to return. * This defaults to 0. * * @param payload.recentAchievementsCount Optional. The number of recent achievements * to return. This defaults to 5. * * @example * ``` * const userSummary = await getUserSummary( * authorization, * { username: "xelnia" } * ); * ``` * * @returns An object containing summary metadata about a target user. */ export declare const getUserSummary: (authorization: AuthObject, payload: { username: string; recentGamesCount?: number; recentAchievementsCount?: number; }) => Promise<UserSummary>;