Roves
roves-api

steam

Achievements, stats, DLC, overlay, and store — Roves' full Steamworks wrapper.

Edit on GitHub

A full Steamworks wrapper with its own module, rather than being routed through core's generic bridge, since it's a large, separate SDK surface, not a general "control this app" command. In the Roves player it uses the player's same-origin host API; in the previous Shell, the steam: protocol.

Requires a Steam package of the player (the _steam release assets, or the Steam option in Packmaster and the GitHub Action; see Steam integration). Every function below degrades to a harmless default (null / false / 0) in a standard package or when Steam isn't running — none of them throw for that reason, so you don't need a separate non-Steam build or a bunch of defensive try/catch.

For achievements specifically, prefer achievements over calling unlockAchievement/isAchievementUnlocked/clearAchievement here directly — same underlying calls, but through a platform-agnostic interface that stays the same if a future non-Steam platform (e.g. Google Play Games Services) is ever added. Everything else here (stats, DLC, overlay, store) is Steam-specific enough that there's no generic equivalent.

import { steam } from "@drincs/roves-api/steam";

if (await steam.isAvailable()) {
  await steam.unlockAchievement("ACH_COMPLETE_CH1");
  await steam.openOverlay("achievements");
}

API

FunctionReturnsNotes
isAvailable()booleantrue once Steam initialized successfully.
getPlayerName()string | nullSteam display name of the logged-in user.
getAppId()number | nullApp ID of the running application.
unlockAchievement(id)booleanUnlocks and immediately persists it. id must match the API Name in Steamworks Partner.
isAchievementUnlocked(id)booleanReliable only after the first few seconds of launch (stats fetch automatically at startup).
clearAchievement(id)booleanDevelopment/testing only.
setStatInt(name, value) / setStatFloat(name, value)booleanCall storeStats() afterwards to persist.
getStatInt(name) / getStatFloat(name)numberReturns 0 on error.
storeStats()booleanCommits pending stat changes. unlockAchievement/clearAchievement already call this automatically.
isDlcInstalled(appId)booleanWhether the user owns and has installed that DLC.
openOverlay(dialog)booleandialog: "achievements", "community", "friends", and other standard overlay panes.
openStore(appId?)booleanOpens the store page for this game, or a different appId.

On this page