Skip to content

Steamworks Integration ​

Add Steam features to your game.

PRO FEATURE

Steamworks integration requires GemShell Pro.

Setup ​

1. Enable Steamworks ​

In GemShell settings, enable Steamworks Integration.

2. Set App ID ​

Enter your Steam App ID. For testing, use 480 (Spacewar demo app).

3. Build ​

Build your game. GemShell automatically:

  • Bundles the Steam runtime
  • Configures the steam_appid.txt
  • Injects the Steam API

Using the Steam API ​

In your game code:

javascript
// Check if Steam is available
if (typeof steam !== 'undefined' && await steam.isAvailable()) {
  // Steam features available
  const name = await steam.getPersonaName();
  console.log(`Hello, ${name}!`);
}

Available Features ​

User Info ​

javascript
const steamId = await steam.getSteamID();
const name = await steam.getPersonaName();
const level = await steam.getPlayerSteamLevel();

Achievements ​

javascript
// Unlock achievement
await steam.unlockAchievement('FIRST_BOSS');
await steam.storeStats();

// Check achievement
const unlocked = await steam.getAchievement('FIRST_BOSS');

Cloud Saves ​

javascript
// Save to cloud
await steam.fileWrite('save.json', JSON.stringify(data));

// Load from cloud
if (await steam.fileExists('save.json')) {
  const content = await steam.fileRead('save.json');
  const data = JSON.parse(content);
}

Rich Presence ​

javascript
await steam.setRichPresence('status', 'In Battle');
await steam.setRichPresence('level', '42');

Leaderboards ​

javascript
const board = await steam.findLeaderboard('HighScores');
if (board) {
  await steam.uploadLeaderboardScore(board, score);
}

Callbacks ​

Call runCallbacks() in your game loop:

javascript
function gameLoop() {
  if (typeof steam !== 'undefined') {
    steam.runCallbacks();
  }
  // ... game logic
  requestAnimationFrame(gameLoop);
}

Testing ​

Local Testing ​

  1. Have Steam running
  2. Build your game
  3. Run the built executable (not from IDE)

With Your App ID ​

  1. Own the game on Steam
  2. Set your App ID in GemShell
  3. Build and run

Test App (480) ​

Use App ID 480 for testing without a real Steam app:

  • Basic features work
  • Achievements use Spacewar's achievements
  • Cloud saves work

Steamworks SDK ​

GemShell bundles the official Steamworks SDK v1.62.

SDK Version

GemShell uses Steamworks SDK version 1.62 (March 2025). This version includes Remote Play Together improvements, UGC load order controls, and the latest API updates.

Supported platforms:

PlatformLibrary
Windows x64steam_api64.dll
Windows x86steam_api.dll
macOSlibsteam_api.dylib
Linux x64libsteam_api.so

Troubleshooting ​

Steam Not Detected ​

  • Ensure Steam is running
  • Run the built executable, not from IDE
  • Check steam_appid.txt exists next to executable

Achievements Not Working ​

  • Call storeStats() after unlocking
  • Verify achievement ID matches Steamworks dashboard
  • Test with App ID 480 first

Cloud Saves Not Syncing ​

  • Enable Steam Cloud in Steamworks dashboard
  • Check isCloudEnabledForApp() returns true
  • File size must be within limits

Full API Reference ​

See Steamworks API for complete documentation.