Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Games

import { Games } from "https://googleapis.deno.dev/v1/games:v1.ts";

The Google Play games service allows developers to enhance games with social leaderboards, achievements, game state, sign-in with Google, and more.

class Games {
constructor(client?: CredentialsClient, baseUrl?: string);
async achievementDefinitionsList(opts?: AchievementDefinitionsListOptions): Promise<AchievementDefinitionsListResponse>;
async achievementsIncrement(achievementId: string, opts?: AchievementsIncrementOptions): Promise<AchievementIncrementResponse>;
async achievementsList(playerId: string, opts?: AchievementsListOptions): Promise<PlayerAchievementListResponse>;
async achievementsReveal(achievementId: string): Promise<AchievementRevealResponse>;
async achievementsSetStepsAtLeast(achievementId: string, opts?: AchievementsSetStepsAtLeastOptions): Promise<AchievementSetStepsAtLeastResponse>;
async achievementsUnlock(achievementId: string): Promise<AchievementUnlockResponse>;
async achievementsUpdateMultiple(req: AchievementUpdateMultipleRequest): Promise<AchievementUpdateMultipleResponse>;
async applicationsGet(applicationId: string, opts?: ApplicationsGetOptions): Promise<Application>;
async applicationsGetEndPoint(opts?: ApplicationsGetEndPointOptions): Promise<EndPoint>;
async applicationsPlayed(): Promise<void>;
async applicationsVerify(applicationId: string): Promise<ApplicationVerifyResponse>;
async eventsListByPlayer(opts?: EventsListByPlayerOptions): Promise<PlayerEventListResponse>;
async eventsListDefinitions(opts?: EventsListDefinitionsOptions): Promise<EventDefinitionListResponse>;
async eventsRecord(req: EventRecordRequest, opts?: EventsRecordOptions): Promise<EventUpdateResponse>;
async leaderboardsGet(leaderboardId: string, opts?: LeaderboardsGetOptions): Promise<Leaderboard>;
async leaderboardsList(opts?: LeaderboardsListOptions): Promise<LeaderboardListResponse>;
async metagameGetMetagameConfig(): Promise<MetagameConfig>;
async metagameListCategoriesByPlayer(
collection: "ALL",
playerId: string,
): Promise<CategoryListResponse>;
async playersGet(playerId: string, opts?: PlayersGetOptions): Promise<Player>;
async playersGetMultipleApplicationPlayerIds(opts?: PlayersGetMultipleApplicationPlayerIdsOptions): Promise<GetMultipleApplicationPlayerIdsResponse>;
async playersGetScopedPlayerIds(): Promise<ScopedPlayerIds>;
async playersList(collection: "CONNECTED" | "VISIBLE" | "FRIENDS_ALL", opts?: PlayersListOptions): Promise<PlayerListResponse>;
async recallLastTokenFromAllDeveloperGames(sessionId: string): Promise<RetrieveDeveloperGamesLastPlayerTokenResponse>;
async recallLinkPersona(req: LinkPersonaRequest): Promise<LinkPersonaResponse>;
async recallResetPersona(req: ResetPersonaRequest): Promise<ResetPersonaResponse>;
async recallRetrieveTokens(sessionId: string): Promise<RetrievePlayerTokensResponse>;
async recallUnlinkPersona(req: UnlinkPersonaRequest): Promise<UnlinkPersonaResponse>;
async revisionsCheck(opts?: RevisionsCheckOptions): Promise<RevisionCheckResponse>;
async scoresGet(
leaderboardId: string,
playerId: string,
timeSpan:
| "ALL"
| "ALL_TIME"
| "WEEKLY"
| "DAILY"
,
): Promise<PlayerLeaderboardScoreListResponse>;
async scoresList(
collection: "PUBLIC" | "SOCIAL" | "FRIENDS",
leaderboardId: string,
): Promise<LeaderboardScores>;
async scoresListWindow(
collection: "PUBLIC" | "SOCIAL" | "FRIENDS",
leaderboardId: string,
): Promise<LeaderboardScores>;
async scoresSubmit(leaderboardId: string, opts?: ScoresSubmitOptions): Promise<PlayerScoreResponse>;
async scoresSubmitMultiple(req: PlayerScoreSubmissionList, opts?: ScoresSubmitMultipleOptions): Promise<PlayerScoreListResponse>;
async snapshotsGet(snapshotId: string, opts?: SnapshotsGetOptions): Promise<Snapshot>;
async snapshotsList(playerId: string, opts?: SnapshotsListOptions): Promise<SnapshotListResponse>;
async statsGet(): Promise<StatsResponse>;
}

§Constructors

§
new Games(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§

Lists all the achievement definitions for your application.

§
achievementsIncrement(achievementId: string, opts?: AchievementsIncrementOptions): Promise<AchievementIncrementResponse>
[src]

Increments the steps of the achievement with the given ID for the currently authenticated player.

@param achievementId

The ID of the achievement used by this method.

§
achievementsList(playerId: string, opts?: AchievementsListOptions): Promise<PlayerAchievementListResponse>
[src]

Lists the progress for all your application's achievements for the currently authenticated player.

@param playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

§
achievementsReveal(achievementId: string): Promise<AchievementRevealResponse>
[src]

Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.

@param achievementId

The ID of the achievement used by this method.

§
achievementsSetStepsAtLeast(achievementId: string, opts?: AchievementsSetStepsAtLeastOptions): Promise<AchievementSetStepsAtLeastResponse>
[src]

Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.

@param achievementId

The ID of the achievement used by this method.

§
achievementsUnlock(achievementId: string): Promise<AchievementUnlockResponse>
[src]

Unlocks this achievement for the currently authenticated player.

@param achievementId

The ID of the achievement used by this method.

§

Updates multiple achievements for the currently authenticated player.

§
applicationsGet(applicationId: string, opts?: ApplicationsGetOptions): Promise<Application>
[src]

Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data.

@param applicationId

The application ID from the Google Play developer console.

§
applicationsGetEndPoint(opts?: ApplicationsGetEndPointOptions): Promise<EndPoint>
[src]

Returns a URL for the requested end point type.

§
applicationsPlayed(): Promise<void>
[src]

Indicate that the currently authenticated user is playing your application.

§
applicationsVerify(applicationId: string): Promise<ApplicationVerifyResponse>
[src]

Verifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for.

@param applicationId

The application ID from the Google Play developer console.

§
eventsListByPlayer(opts?: EventsListByPlayerOptions): Promise<PlayerEventListResponse>
[src]

Returns a list showing the current progress on events in this application for the currently authenticated user.

§
eventsListDefinitions(opts?: EventsListDefinitionsOptions): Promise<EventDefinitionListResponse>
[src]

Returns a list of the event definitions in this application.

§

Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.

§
leaderboardsGet(leaderboardId: string, opts?: LeaderboardsGetOptions): Promise<Leaderboard>
[src]

Retrieves the metadata of the leaderboard with the given ID.

@param leaderboardId

The ID of the leaderboard.

§
leaderboardsList(opts?: LeaderboardsListOptions): Promise<LeaderboardListResponse>
[src]

Lists all the leaderboard metadata for your application.

§
metagameGetMetagameConfig(): Promise<MetagameConfig>
[src]

Return the metagame configuration data for the calling application.

§
metagameListCategoriesByPlayer(collection: "ALL", playerId: string, opts?: MetagameListCategoriesByPlayerOptions): Promise<CategoryListResponse>
[src]

List play data aggregated per category for the player corresponding to playerId.

@param collection

The collection of categories for which data will be returned.

@param playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

§
playersGet(playerId: string, opts?: PlayersGetOptions): Promise<Player>
[src]

Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.

@param playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

§

Get the application player ids for the currently authenticated player across all requested games by the same developer as the calling application. This will only return ids for players that actually have an id (scoped or otherwise) with that game.

§
playersGetScopedPlayerIds(): Promise<ScopedPlayerIds>
[src]

Retrieves scoped player identifiers for currently authenticated user.

§
playersList(collection: "CONNECTED" | "VISIBLE" | "FRIENDS_ALL", opts?: PlayersListOptions): Promise<PlayerListResponse>
[src]

Get the collection of players for the currently authenticated user.

@param collection

Collection of players being retrieved

§
recallLastTokenFromAllDeveloperGames(sessionId: string): Promise<RetrieveDeveloperGamesLastPlayerTokenResponse>
[src]

Retrieve the last Recall token from all developer games that is associated with the PGS Player principal encoded in the provided recall session id. The API is only available for users that have active PGS Player profile.

@param sessionId

Required. Opaque server-generated string that encodes all the necessary information to identify the PGS player / Google user and application.

§
recallLinkPersona(req: LinkPersonaRequest): Promise<LinkPersonaResponse>
[src]

Associate the PGS Player principal encoded in the provided recall session id with an in-game account

§
recallResetPersona(req: ResetPersonaRequest): Promise<ResetPersonaResponse>
[src]

Delete all Recall tokens linking the given persona to any player (with or without a profile).

§
recallRetrieveTokens(sessionId: string): Promise<RetrievePlayerTokensResponse>
[src]

Retrieve all Recall tokens associated with the PGS Player principal encoded in the provided recall session id. The API is only available for users that have active PGS Player profile.

@param sessionId

Required. Opaque server-generated string that encodes all the necessary information to identify the PGS player / Google user and application.

§
recallUnlinkPersona(req: UnlinkPersonaRequest): Promise<UnlinkPersonaResponse>
[src]

Delete a Recall token linking the PGS Player principal identified by the Recall session and an in-game account identified either by the 'persona' or by the token value.

§
revisionsCheck(opts?: RevisionsCheckOptions): Promise<RevisionCheckResponse>
[src]

Checks whether the games client is out of date.

§
scoresGet(leaderboardId: string, playerId: string, timeSpan: "ALL" | "ALL_TIME" | "WEEKLY" | "DAILY", opts?: ScoresGetOptions): Promise<PlayerLeaderboardScoreListResponse>
[src]

Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. `NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.

@param leaderboardId

The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.

@param playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

@param timeSpan

The time span for the scores and ranks you're requesting.

§
scoresList(collection: "PUBLIC" | "SOCIAL" | "FRIENDS", leaderboardId: string, opts?: ScoresListOptions): Promise<LeaderboardScores>
[src]

Lists the scores in a leaderboard, starting from the top.

@param collection

The collection of scores you're requesting.

@param leaderboardId

The ID of the leaderboard.

§
scoresListWindow(collection: "PUBLIC" | "SOCIAL" | "FRIENDS", leaderboardId: string, opts?: ScoresListWindowOptions): Promise<LeaderboardScores>
[src]

Lists the scores in a leaderboard around (and including) a player's score.

@param collection

The collection of scores you're requesting.

@param leaderboardId

The ID of the leaderboard.

§
scoresSubmit(leaderboardId: string, opts?: ScoresSubmitOptions): Promise<PlayerScoreResponse>
[src]

Submits a score to the specified leaderboard.

@param leaderboardId

The ID of the leaderboard.

§

Submits multiple scores to leaderboards.

§
snapshotsGet(snapshotId: string, opts?: SnapshotsGetOptions): Promise<Snapshot>
[src]

Retrieves the metadata for a given snapshot ID.

@param snapshotId

The ID of the snapshot.

§
snapshotsList(playerId: string, opts?: SnapshotsListOptions): Promise<SnapshotListResponse>
[src]

Retrieves a list of snapshots created by your application for the player corresponding to the player ID.

@param playerId

A player ID. A value of me may be used in place of the authenticated player's ID.

§
statsGet(): Promise<StatsResponse>
[src]

Returns engagement and spend statistics in this application for the currently authenticated user.