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

platform-achievements

v0.1.1

Published

Cross-platform game achievements: one definition list mirrored to Google Play Games, Game Center and Steam with an idempotent earned-minus-acknowledged sync, structural adapters for the Capacitor game-services plugin and steamworks.js, and store-console s

Readme

platform-achievements

Cross-platform game achievements. Describe your achievements once, then mirror them to Google Play Games, Game Center and Steam with a sync that is safe to call from anywhere, any number of times. Generate the files the three store consoles want from the same list. No runtime dependencies: the Capacitor game-services plugin and the steamworks.js client are passed in.

npm install platform-achievements

The model

Four ideas carry the whole package.

  • Earned versus acknowledged. What the player has earned is the game's own truth. What a platform has acknowledged is what that platform confirmed receiving. A platform still needs exactly earned − acknowledged. Nothing is queued by hand, so a report that failed, was never sent or was sent while offline is simply still outstanding the next time you sync.
  • Absolute progress. An incremental achievement ("win 10 matches") is described by the steps reached, 7, not by "add 3". Steam takes the absolute value. Play Games and Game Center only add, so the adapter sends the difference from the last acknowledged value.
  • Idempotent sync. An acknowledgement is recorded only after the platform confirms it, and never goes backwards. Syncing twice sends nothing the second time; one failing report never blocks the others.
  • Structural adapters. Each adapter asks for the few methods it needs, typed as an interface. This package imports no Capacitor, no Play Games plugin and no Steam module.

Quick start

import {
  MemoryAcknowledgementStore,
  resolveAchievements,
  syncAchievements,
} from 'platform-achievements'
import { gameServicesAchievements } from 'platform-achievements/game-services'

// 1. Describe the achievements once.
const achievements = resolveAchievements(
  [
    { key: 'first-win', name: 'First Win', description: 'Win your first match.', points: 5 },
    {
      key: 'ten-wins',
      name: 'Ten Wins',
      description: 'Win 10 matches, in any mode.',
      points: 10,
      steps: 10, // incremental: a progress bar of 10 steps
    },
  ],
  { gameCenterNamespace: 'com.example.game' },
)

// 2. Pick the adapter for this build. `plugin` is your Capacitor game-services plugin.
const adapter = gameServicesAchievements(plugin, 'game-center') // or 'play' on Android

// 3. Sync whenever it might help: on sign-in, on resume, after a match.
const result = await syncAchievements({
  achievements,
  earned: { 'first-win': 1, 'ten-wins': 7 }, // from your save data
  adapter,
  store: new MemoryAcknowledgementStore(), // use a durable store of your own in a real game
})
// { sent: 2, failed: 0, errors: [], unaddressed: 0, signedIn: true }

earned maps a key to what the player has: 1 for a standard achievement, the steps reached for an incremental one. Everything else, including which reports to send and what to remember, follows from it.

Entry points

| Import | What it gives you | | --- | --- | | platform-achievements | resolveAchievements, outstanding, syncAchievements, AcknowledgementStore and MemoryAcknowledgementStore, validateAchievements and CONSOLE_LIMITS | | platform-achievements/game-services | gameServicesAchievements(plugin, 'play' \| 'game-center') for the Capacitor game-services plugin | | platform-achievements/steam | steamAchievements(client) for a steamworks.js client | | platform-achievements/web | webAchievements, a no-op for builds with no platform profile | | platform-achievements/export | Play Console, App Store Connect and Steamworks submission files, and a flat ZIP for the Play import |

Both ESM and CommonJS are shipped, with types for each.

What each platform supports

| | Google Play Games | Game Center | Steam | | --- | --- | --- | --- | | Unlock | idempotent | idempotent | idempotent | | Progress | adds whole steps | adds percentage points | sets a stat, absolute | | Needs a durable acknowledgement store for progress | yes | yes | no, but it still stores | | Hidden achievements | yes | yes | yes | | Ids | generated by the console after import (playIds) | yours, permanent (gameCenterNamespace) | yours (ACH_<KEY>, STAT_<KEY>) | | Bulk import | CSV and icons in a flat ZIP | JSON records and icons | none; enter by hand from the JSON | | Icons | 512 px PNG | 1024 px PNG | 256 px JPEG, earned and locked |

Details, limits and the order to do things in are in docs/platforms.md.

Store console files

import { playConsoleZip, submission } from 'platform-achievements/export'

const { files, icons } = submission(achievements)
// files: 'play/AchievementsMetadata.csv', 'app-store-connect/app-store-connect.json', ...
// icons: [{ path: 'play/first-win.png', key: 'first-win', size: 512, format: 'png', locked: false }, ...]
// Draw each icon at its size, then:
const zip = playConsoleZip({ ...files, ...drawnIcons }) // drawnIcons: path -> bytes

The package decides what files exist, what they are called and how big each icon is. You draw the icons however your game draws things.

Compatibility

  • Node.js 22, 24 and 26 (the maintained lines; engines.node is >=22). The package is plain TypeScript with no platform APIs, so it also runs in browsers and in a Capacitor webview.
  • @idleflowgames/capacitor-play-games 0.3 on Capacitor 8 matches the game-services interface, and steamworks.js 0.4 matches the Steam one. Both are typed structurally, so any compatible object works.

Documentation

License

MIT. Copyright (c) 2026 Jon Bogaty.