Skip to content

Getting started

const steamworks = require('steamworks.js')
// You can pass an appId, or don't pass anything and use a steam_appid.txt file
const client = steamworks.init(480)
// Print Steam username
console.log(client.localplayer.getName())
// Tries to activate an achievement
if (client.achievement.activate('ACHIEVEMENT')) {
// ...
}

You can refer to the declarations file to check the API support and get more detailed documentation of each function.

Every namespace below is on the client returned by init(). Every function, with its parameters, return value and failure cases, is in the API reference, which is rendered from the JSDoc in client.d.ts. Most calls need a running, logged-in Steam client. Anything marked unverified has not been run against a live client yet.

Area Namespaces Where to read more
Steam Workshop (UGC) workshop The Workshop sections below, and the agent skills for publishing, updating, querying and client state
Friends and identity friends, localplayer, auth Friends; the API reference for the rest
Stats, achievements, leaderboards stats, achievement, leaderboard Stats, Achievements and Leaderboards
Networking networking, networkingSockets, networkingMessages, networkingUtils Networking
Servers, lobbies, Remote Play matchmaking, matchmakingServers, remotePlay Server Browser, Timeline, Screenshots and Remote Play; lobbies are in the API reference
Timeline and screenshots timeline, screenshots Same section
App, overlay, input, cloud, utilities apps, overlay, input, cloud, utils, callback Supplemental Functions; the API reference for the rest

What the Workshop namespace can do today:

  • Read: getItem, getItems, getAllItems, getUserItems, with additional previews, supported game versions and dependency links on request.
  • Create and update: createItem (any WorkshopFileType), updateItem and its preview-only and content-only helpers, with title and description per language, tags, visibility, metadata, key-value tags, content descriptors, screenshots, YouTube videos and game-version ranges.
  • Dependencies: required items (addDependency, removeDependency) and required apps (addAppDependency, removeAppDependency, getAppDependencies).
  • The logged-in user: subscribe, download and install info, votes, favorites and playtime tracking.

Not in scope: remote_storage publish and screenshots tagging

Section titled “Not in scope: remote_storage publish and screenshots tagging”

These two parts of the SDK are deliberately not wrapped. This section records the decision and its reasons, so the question is not reopened without new facts. The public API did not change for it: client.d.ts has no remote_storage publish function and no screenshots tagging function.

Feature Decision Checked in the code or SDK headers Reason Unverified
remote_storage publish (PublishWorkshopFile) Exclude The SDK header declares PublishWorkshopFile with the other remote storage calls. Nothing in this repository wraps or calls it. The UGC calls this binding already wraps (createItem, updateItem, the dependency and preview calls) cover publishing. A second publish route would need its own tests and skill. Whether Steam still accepts this route for current accounts.
Screenshots tagging (TagPublishedFile) Defer The header declares TagPublishedFile on ISteamScreenshots. The screenshots namespace only hooks the screenshot hotkey. The call needs a screenshot handle from the hooked hotkey flow. Without a use case in this repository, a wrapper would ship untested. Reopen it when a consumer needs it. Whether a tag call succeeds and shows on the item page. It needs a running client.

Recommendation: keep both out of the public API. When screenshots tagging is needed, start with a live check on a private test item.

To use steamworks.js you don’t have to build anything, just install it from npm:

Terminal window
npm i @hagicode/steamworks.js

Guides and agent skills are on the documentation site at https://steamworks.hagicode.com/. To try the latest build from main, install the dev dist-tag: npm i @hagicode/steamworks.js@dev.

If you were using the unscoped upstream steamworks.js package and want this fork instead, update your package.json:

{
"dependencies": {
"@hagicode/steamworks.js": "latest"
}
}

Then run pnpm install. Your require('steamworks.js') statements will continue to work without changes.

Steamworks.js is a native module and cannot be used by default in the renderer process. To enable the usage of native modules on the renderer process, the following configurations should be made on main.js:

const mainWindow = new BrowserWindow({
// ...
webPreferences: {
// ...
contextIsolation: false,
nodeIntegration: true
}
})

To make the steam overlay working, call the electronEnableSteamOverlay on the end of your main.js file:

require('steamworks.js').electronEnableSteamOverlay()

For the production build, copy the relevant distro files from sdk/redistributable_bin/{YOUR_DISTRO} into the root of your build. If you are using electron-forge, look for #75.

Turn ideas into shipped software.

HagiCode is an agentic coding workspace. OpenSpec workflows plan the change, multi-agent execution carries it out, and Hero Scenario makes the long run visible, so ideas become shipped software.

Smart
OpenSpec workflows turn intent into a path from proposal to shipped change.
Efficient
Multi-agent execution runs research, build, and review in parallel.
Fun
Rich UI interactions make planning, agent work, and projects easier to follow.