Skip to content

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 sent
await client.workshop.updateItem(itemId, { additionalPreviewPaths: ['/abs/path/shot-2.png'] }, appId)
// remove: pass the 0-based indexes from `additionalPreviews`; the main preview is not affected
await 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.

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 uploaded
await client.workshop.updateItemPreview(itemId, '/abs/path/preview.png', appId, 'New preview')
// upload only the mod folder; the preview image is not touched
await client.workshop.updateItemContent(itemId, '/abs/path/mod-folder', appId, 'Fix crash on load')
  • Signature for both: (itemId, path, appId?, changeNote?). appId defaults to the app the client was initialized with, and changeNote is optional.
  • updateItemPreview rejects when the path is missing or is not a file. updateItemContent rejects 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.

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. add takes { key, value } pairs and remove takes keys.
  • contentDescriptors: { remove?, add? } of WorkshopContentDescriptor values, 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.Art
await 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 upload sends --file-type and the YouTube videos listed in workshop.json. It does not send metadata, key-value tags or content descriptors; those are steamworks.js calls only.

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 account
const requiredId = 3836453389n // the required child item (Outing Picker)
// mark the child as required by the mod
const 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 way
const 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.

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.

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 down
const vote = await client.workshop.getUserItemVote(itemId) // { votedUp, votedDown, skipped }
await client.workshop.addItemToFavorites(itemId) // appId defaults to the client's app
await client.workshop.removeItemFromFavorites(itemId)
await client.workshop.startPlaytimeTracking([itemId]) // the list must not be empty
await 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.

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 update
await client.workshop.updateItem(itemId, {
contentPath: '/abs/path/mod-folder',
requiredGameVersionMin: 'open_beta',
requiredGameVersionMax: '',
}, appId)
  • supportedGameVersions comes with items from getItem, getItems, getAllItems and getUserItems. 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 contentPath with 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.

Steamworks.js supports localized content for Steam Workshop items. You can update the title and description for different languages using the language parameter.

// 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 content
await workshop.updateItem(itemId, {
title: "我的模组",
description: "中文描述",
language: "schinese"
});

Since Steam API only supports updating one language at a time, you need to make multiple updateItem() calls for each language:

// Sequential updates
await 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"
})
]);

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.