npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ra-google-play-service

v0.0.1

Published

Expose Google Play Game Service API

Readme

ra-google-play-service

Expose Google Play Game Service API

Install

npm install ra-google-play-service
npx cap sync

API

signIn()

signIn() => Promise<SignInResult>

Sign in the user to Google Play Games Services

Returns: Promise<SignInResult>


signOut()

signOut() => Promise<void>

Sign out the user from Google Play Games Services


isSignedIn()

isSignedIn() => Promise<{ isSignedIn: boolean; }>

Check if user is signed in to Google Play Games Services

Returns: Promise<{ isSignedIn: boolean; }>


getPlayerInfo()

getPlayerInfo() => Promise<PlayerInfo>

Get the currently signed in player information

Returns: Promise<PlayerInfo>


showLeaderboard(...)

showLeaderboard(options: LeaderboardOptions) => Promise<void>

Show the leaderboard UI for a specific leaderboard

| Param | Type | Description | | ------------- | ----------------------------------------------------------------- | --------------------------------- | | options | LeaderboardOptions | Options containing leaderboard ID |


showAllLeaderboards()

showAllLeaderboards() => Promise<void>

Show all leaderboards UI


submitScore(...)

submitScore(options: SubmitScoreOptions) => Promise<void>

Submit a score to a leaderboard

| Param | Type | Description | | ------------- | ----------------------------------------------------------------- | ------------------------------------------- | | options | SubmitScoreOptions | Options containing leaderboard ID and score |


showAchievements()

showAchievements() => Promise<void>

Show the achievements UI


unlockAchievement(...)

unlockAchievement(options: AchievementOptions) => Promise<void>

Unlock an achievement

| Param | Type | Description | | ------------- | ----------------------------------------------------------------- | --------------------------------- | | options | AchievementOptions | Options containing achievement ID |


incrementAchievement(...)

incrementAchievement(options: IncrementAchievementOptions) => Promise<void>

Increment an achievement with the specified amount

| Param | Type | Description | | ------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------ | | options | IncrementAchievementOptions | Options containing achievement ID and increment amount |


revealAchievement(...)

revealAchievement(options: AchievementOptions) => Promise<void>

Reveal a hidden achievement

| Param | Type | Description | | ------------- | ----------------------------------------------------------------- | --------------------------------- | | options | AchievementOptions | Options containing achievement ID |


saveGameData(...)

saveGameData(options: SaveGameOptions) => Promise<SaveResult>

Save game data to the cloud

| Param | Type | Description | | ------------- | ----------------------------------------------------------- | -------------------------------------------- | | options | SaveGameOptions | Options containing save data and description |

Returns: Promise<SaveResult>


loadGameData(...)

loadGameData(options: LoadGameOptions) => Promise<LoadGameResult>

Load saved game data from the cloud

| Param | Type | Description | | ------------- | ----------------------------------------------------------- | ------------------------------ | | options | LoadGameOptions | Options for loading saved game |

Returns: Promise<LoadGameResult>


showSavedGames(...)

showSavedGames(options: ShowSavedGamesOptions) => Promise<LoadGameResult>

Show the saved games UI

| Param | Type | Description | | ------------- | ----------------------------------------------------------------------- | ---------------------------------- | | options | ShowSavedGamesOptions | Options for showing saved games UI |

Returns: Promise<LoadGameResult>


addListener('signInStatusChanged', ...)

addListener(eventName: 'signInStatusChanged', listenerFunc: (result: SignInResult) => void) => Promise<PluginListenerHandle>

Add listener for sign-in state changes

| Param | Type | Description | | ------------------ | -------------------------------------------------------------------------- | ------------------- | | eventName | 'signInStatusChanged' | Event to listen for | | listenerFunc | (result: SignInResult) => void | Callback function |

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin


Interfaces

SignInResult

| Prop | Type | Description | | ----------------- | -------------------- | ---------------------------------------------- | | isSignedIn | boolean | Whether the user is signed in | | playerId | string | Player ID if signed in | | displayName | string | Player display name if signed in | | imageUrl | string | URL to the player's profile image if signed in | | error | string | Error message if sign in failed |

PlayerInfo

| Prop | Type | Description | | ----------------- | ------------------- | --------------------------------- | | playerId | string | Player ID | | displayName | string | Player display name | | imageUrl | string | URL to the player's profile image |

LeaderboardOptions

| Prop | Type | Description | | ------------------- | ------------------- | ------------------------------------------------ | | leaderboardId | string | Leaderboard ID as defined in Google Play Console |

SubmitScoreOptions

| Prop | Type | Description | | ----------- | ------------------- | ---------------------------------- | | score | number | Score to submit to the leaderboard |

AchievementOptions

| Prop | Type | Description | | ------------------- | ------------------- | ------------------------------------------------ | | achievementId | string | Achievement ID as defined in Google Play Console |

IncrementAchievementOptions

| Prop | Type | Description | | ----------- | ------------------- | -------------------------------------- | | steps | number | Amount to increment the achievement by |

SaveResult

| Prop | Type | Description | | ------------- | -------------------- | ---------------------------- | | success | boolean | Whether save was successful | | saveId | string | Save ID of the saved game | | error | string | Error message if save failed |

SaveGameOptions

| Prop | Type | Description | | ----------------- | ------------------- | ----------------------------------------------- | | saveId | string | Unique identifier for the save | | data | string | Save data as string (will be encoded as needed) | | description | string | Human readable description of the save |

LoadGameResult

| Prop | Type | Description | | --------------------------- | -------------------- | ------------------------------------ | | success | boolean | Whether data was successfully loaded | | saveId | string | Save ID that was loaded | | data | string | The loaded save data | | description | string | Description of the save | | lastModifiedTimestamp | number | Last modified timestamp | | error | string | Error message if load failed |

LoadGameOptions

| Prop | Type | Description | | ------------ | ------------------- | -------------------------------------- | | saveId | string | Unique identifier for the save to load |

ShowSavedGamesOptions

| Prop | Type | Description | | -------------------- | -------------------- | ----------------------------------- | | title | string | Title to show in the saved games UI | | allowAddButton | boolean | Whether to allow creating new saves | | allowDelete | boolean | Whether to allow deleting saves | | maxSavedGames | number | Maximum number of saves to show |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |