Roves
roves-api

steam

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

Edit on GitHub

A full Steamworks wrapper, talking to its own dedicated steam: protocol — Steam gets its own protocol rather than being routed through core's generic roves: bridge, since it's a large, separate SDK surface, not a general "control this app" command.

Requires the native binary to be built with --features steam (see Steam integration). Every function below degrades to a harmless default (null / false / 0) when Steam isn't compiled in or 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.

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