Steam Workshop
Workshop Screenshots (Additional Previews)
Section titled “Workshop Screenshots (Additional Previews)”Besides the main preview, a Workshop item can show extra screenshots. Read them with includeAdditionalPreviews, and add more with additionalPreviewPaths (an update that carries only the new images):
const steamworks = require('steamworks.js')const client = steamworks.init(appId)
// list: each entry has urlOrVideoId, originalFilename and previewType (ItemPreviewType)const item = await client.workshop.getItem(itemId, { includeAdditionalPreviews: true })console.log(item.additionalPreviews)
// add: appended to the item's screenshots; no content and no title change are sentawait client.workshop.updateItem(itemId, { additionalPreviewPaths: ['/abs/path/shot-2.png'] }, appId)
// remove: pass the 0-based indexes from `additionalPreviews`; the main preview is not affectedawait client.workshop.updateItem(itemId, { removeAdditionalPreviewIndexes: [0, 2] }, appId)- Removals run before additions in the same update, from the highest index down. Indexes always refer to the list as it was before this update, so read the list again before removing.
- Screenshots cannot be reordered through this API. The main preview is replaced with
previewPath, not removed. - Steam lists screenshots by file name. Send only the files that are not listed yet, otherwise they are added again.
- Adding screenshots needs a Steam client that is running and logged in, and an account that owns the app.
Workshop Preview and Content Updates
Section titled “Workshop Preview and Content Updates”updateItem accepts every field as optional, so a call that carries only previewPath or only contentPath already updates just that part. Two explicit helpers make that intent obvious and check the path before talking to Steam:
const steamworks = require('steamworks.js')const client = steamworks.init(appId)
// replace only the main preview image; the mod files are not uploadedawait client.workshop.updateItemPreview(itemId, '/abs/path/preview.png', appId, 'New preview')
// upload only the mod folder; the preview image is not touchedawait client.workshop.updateItemContent(itemId, '/abs/path/mod-folder', appId, 'Fix crash on load')- Signature for both:
(itemId, path, appId?, changeNote?).appIddefaults to the app the client was initialized with, andchangeNoteis optional. updateItemPreviewrejects when the path is missing or is not a file.updateItemContentrejects when the path is missing or is not a folder. Both check before any Steam call.- Title, description, tags and visibility are not sent, so they stay as they are. To change them together with a file, keep using
updateItem. - Neither helper reports upload progress. For a large content upload use
updateItemWithCallback.
Creating items and the new update fields
Section titled “Creating items and the new update fields”createItem(appId?, fileType?) creates an empty item. Without fileType it is a Community item, as before. The WorkshopFileType values are Community, Art, Screenshot, Video, Collection, WebGuide and IntegratedGuide.
updateItem accepts these optional fields. A field left out keeps the item’s current value:
additionalPreviewVideos: YouTube video IDs, 11 characters each, not URLs. A malformed ID rejects with the entry named, before anything is sent. Whether Steam shows a video added this way is unverified until a live run.metadata: a developer metadata string.keyValueTags:{ clear?, remove?, add? }, applied in the order clear, remove, add.addtakes{ key, value }pairs andremovetakes keys.contentDescriptors:{ remove?, add? }ofWorkshopContentDescriptorvalues, removals first. Only the five SDK values exist, so any other number is refused.
const steamworks = require('steamworks.js')const client = steamworks.init(appId)const { WorkshopFileType, WorkshopContentDescriptor } = client.workshop
const created = await client.workshop.createItem(appId, 1) // 1 = WorkshopFileType.Artawait client.workshop.updateItem(created.itemId, { metadata: 'v2', keyValueTags: { clear: true, add: [{ key: 'mode', value: 'hard' }] }, contentDescriptors: { add: [5] }, // 5 = WorkshopContentDescriptor.AnyMatureContent additionalPreviewVideos: ['dQw4w9WgXcQ'],}, appId)- Each of these calls changes the item on Steam. Confirm the item and the change first.
- The typings expose no read for an item’s metadata, key-value tags or content descriptors, so after a write only the Steam result code can be checked.
workshop.py uploadsends--file-typeand the YouTube videos listed inworkshop.json. It does not send metadata, key-value tags or content descriptors; those are steamworks.js calls only.
Workshop Item Dependencies
Section titled “Workshop Item Dependencies”A Workshop item can require another item, so Steam installs the required item along with it. addDependency and removeDependency take the parent and the child as bigint ids and resolve with the Steam result code. 1 means OK. Any other code is a Steam failure reason, and it arrives as a resolved number, not a rejection.
const steamworks = require('steamworks.js')const client = steamworks.init(appId)
const modId = 123456789n // your mod: an item owned by the logged-in accountconst requiredId = 3836453389n // the required child item (Outing Picker)
// mark the child as required by the modconst added = await client.workshop.addDependency(modId, requiredId)if (added !== 1) { console.error(`Steam refused the dependency, result code ${added}`)}
// remove it again; the result code is returned the same wayconst removed = await client.workshop.removeDependency(modId, requiredId)- Both calls need a running, logged-in Steam client, and the parent must be an item the logged-in account owns.
- An id that is negative or does not fit in 64 bits rejects before any Steam call. A failed call with no completion also rejects, and the error says the outcome is unknown, so check the item before retrying.
App dependencies
Section titled “App dependencies”An item can also require an app, such as a DLC. addAppDependency(itemId, appId) and removeAppDependency(itemId, appId) resolve with the Steam result code, the same way as the item calls above.
getAppDependencies(itemId) resolves with { result, appIds, totalAppDependencies }. Steam sends the list in pages of up to 32, and the binding collects them until the reported total is reached. If appIds is shorter than totalAppDependencies, the list is incomplete. The paging follows the SDK header, and it is unverified against a live Steam client.
Workshop User Actions
Section titled “Workshop User Actions”These calls act for the logged-in user on Steam, so they change that user’s state and not only the item. Each one resolves when Steam confirms it. getUserItemVote is the only one that reads.
const steamworks = require('steamworks.js')const client = steamworks.init(appId)
await client.workshop.setUserItemVote(itemId, true) // vote up; false votes downconst vote = await client.workshop.getUserItemVote(itemId) // { votedUp, votedDown, skipped }
await client.workshop.addItemToFavorites(itemId) // appId defaults to the client's appawait client.workshop.removeItemFromFavorites(itemId)
await client.workshop.startPlaytimeTracking([itemId]) // the list must not be emptyawait client.workshop.stopPlaytimeTracking([itemId])- Item ID 0, a negative id and an empty playtime list are refused before any Steam call.
- Start and stop playtime tracking in pairs. The SDK header describes these calls as tracking the user’s playtime for the listed items; that behavior is unverified against a live client.
- These calls need a running, logged-in Steam client.
Workshop Known Game Versions
Section titled “Workshop Known Game Versions”An item can declare the game versions (Steam branches such as open_beta or public) it is valid for. Every item returned by a query carries those ranges in supportedGameVersions, and updateItem changes them with requiredGameVersionMin and requiredGameVersionMax:
const steamworks = require('steamworks.js')const client = steamworks.init(appId)
// read: one entry per range; an open end is left out (undefined)const item = await client.workshop.getItem(itemId)console.log(item.supportedGameVersions) // e.g. [{ minBranch: 'open_beta', maxBranch: 'open_beta' }, { minBranch: 'public' }]
// change: valid for open_beta and every branch published after it; the content is sent in the same updateawait client.workshop.updateItem(itemId, { contentPath: '/abs/path/mod-folder', requiredGameVersionMin: 'open_beta', requiredGameVersionMax: '',}, appId)supportedGameVersionscomes with items fromgetItem,getItems,getAllItemsandgetUserItems. It is an empty list when Steam returns no range for the item.- Both change fields are optional. Setting one changes that end, and the other end is left open. Leaving both out keeps the range as it is.
- Pass both as
""to make the item valid for every game version again. - Steam applies the range only when the same update changes the item’s content, so send
contentPathwith it. Otherwise Steam does not apply the range. - Changing the range needs a running, logged-in Steam client and an item the logged-in account owns.
Workshop Multilingual Support
Section titled “Workshop Multilingual Support”Steamworks.js supports localized content for Steam Workshop items. You can update the title and description for different languages using the language parameter.
Basic Usage
Section titled “Basic Usage”// Update English content (backward compatible - no language specified)await workshop.updateItem(itemId, { title: "My Mod", description: "English description"});
// Update English content (explicitly)await workshop.updateItem(itemId, { title: "My Mod", description: "English description", language: "english"});
// Update Chinese contentawait workshop.updateItem(itemId, { title: "我的模组", description: "中文描述", language: "schinese"});Multiple Languages
Section titled “Multiple Languages”Since Steam API only supports updating one language at a time, you need to make multiple updateItem() calls for each language:
// Sequential updatesawait workshop.updateItem(itemId, { title: "My Mod", description: "English description", language: "english"});
await workshop.updateItem(itemId, { title: "Mon Mod", description: "Description française", language: "french"});
await workshop.updateItem(itemId, { title: "Mi Mod", description: "Descripción en español", language: "spanish"});Or use Promise.all() for parallel updates:
await Promise.all([ workshop.updateItem(itemId, { title: "Mein Mod", description: "Deutsche Beschreibung", language: "german" }), workshop.updateItem(itemId, { title: "私のMod", description: "日本語の説明", language: "japanese" }), workshop.updateItem(itemId, { title: "내 모드", description: "한국어 설명", language: "korean" })]);Supported Language Codes
Section titled “Supported Language Codes”Steam supports the following language codes:
| Code | Language | Code | Language |
|---|---|---|---|
english |
English | schinese |
Simplified Chinese |
tchinese |
Traditional Chinese | german |
German |
french |
French | italian |
Italian |
korean |
Korean | spanish |
Spanish |
russian |
Russian | thai |
Thai |
japanese |
Japanese | portuguese |
Portuguese |
polish |
Polish | danish |
Danish |
dutch |
Dutch | finnish |
Finnish |
norwegian |
Norwegian | swedish |
Swedish |
hungarian |
Hungarian | czech |
Czech |
romanian |
Romanian | turkish |
Turkish |
brazilian |
Brazilian Portuguese | bulgarian |
Bulgarian |
greek |
Greek | arabic |
Arabic |
ukrainian |
Ukrainian | vietnamese |
Vietnamese |
Note: If language is omitted, it defaults to "english".
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.
© 2026 HagiCode | Powered By hagilight-starlight@0.23.0 | Branch: main | Commit: 7164ec7 | Built:
