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

expo-play-games

v1.0.0

Published

Expo module wrapping Google Play Games Services v2 for Android (leaderboards, achievements, sign-in)

Readme

expo-play-games

Expo module wrapping Google Play Games Services v2 for Android. Provides sign-in, leaderboards, and achievements via a clean TypeScript API.

Android only. iOS is not supported — all methods will throw on iOS/web.


Installation

npm install expo-play-games
# or
pnpm add expo-play-games

No config plugin is required. The SDK is initialized automatically when the module loads.


API

import { PlayGames } from "expo-play-games";

Authentication

// Trigger the Play Games sign-in flow
const authenticated: boolean = await PlayGames.signIn();

// Check if the user is currently signed in
const isSignedIn: boolean = await PlayGames.isSignedIn();

// No-op on v2 — resolves immediately (user manages access from the Play Games app)
await PlayGames.signOut();

// Get the currently signed-in player's info
const player = await PlayGames.getCurrentPlayer();
// { playerId: string, displayName: string, title: string | null }

Leaderboards

// Submit a score (score must be a non-negative integer)
const submitted: boolean = await PlayGames.submitScore("leaderboard_id", 12345);

// Open the Play Games leaderboard UI for a specific leaderboard
await PlayGames.showLeaderboard("leaderboard_id");

// Open the Play Games leaderboard UI showing all leaderboards
await PlayGames.showAllLeaderboards();

Achievements

// Unlock a standard (non-incremental) achievement
const unlocked: boolean = await PlayGames.unlockAchievement("achievement_id");

// Increment an incremental achievement by N steps; resolves true if newly completed
const completed: boolean = await PlayGames.incrementAchievement(
  "achievement_id",
  1,
);

// Open the Play Games achievements UI
await PlayGames.showAchievements();

All methods throw a descriptive Error on failure — wrap calls in try/catch.


Setup required in the consuming app

1. Google Play Console

  1. Your app must exist in Play Console (even as a draft).
  2. Go to Grow → Play Games Services → Setup and management → Configuration.
  3. Create a new Play Games Services project and link it to your app.
  4. Create the leaderboards and achievements you need — note their IDs.

2. Google Cloud Console

  1. Open the Cloud project linked to your Play Games project.
  2. Go to APIs & Services → Credentials → Create Credential → OAuth 2.0 Client ID.
  3. Select Android, enter your app's package name and the SHA-1 fingerprint of your signing certificate.
    • Debug SHA-1: keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
    • Release SHA-1: use the fingerprint from your upload key or Play-managed signing.
  4. No google-services.json changes are needed — Play Games v2 uses the OAuth credential automatically.

3. App startup

PlayGamesSdk.initialize() is called automatically when the module loads (in OnCreate). You do not need to call anything manually before using the API.

If you want to silently sign in on app launch (recommended), call:

useEffect(() => {
  PlayGames.signIn().catch(() => {
    // User not signed in — show a manual sign-in button
  });
}, []);

4. Leaderboard / Achievement IDs

IDs are the string identifiers from Play Console (e.g. CgkI...). Pass them directly to the relevant methods.


Not supported

  • iOS - This module is specifically for Android.`

Out of scope (v1)

  • Saved games / cloud save