Skip to content
Aspen edited this page Oct 15, 2025 · 3 revisions

Getting Started

This guide walks you through setting up steamworks.js in your project.


1. Prerequisites

  • Node.js
  • Steam must be installed and running
  • A Steam App ID (use 480 — Valve’s Spacewar test app)
  • For desktop apps: Electron or a compatible wrapper

2. Installation

npm install steamworks.js

3. Initialization

Below are quick examples for different environments.

Node.js

const steamworks = require('steamworks.js');
const client = steamworks.init(480);
console.log('Player name:', client.localplayer.getName());

Electron (Main Process)

const { app, BrowserWindow } = require('electron');
const steamworks = require('steamworks.js');

app.whenReady().then(() => {
  const client = steamworks.init(480);

  const mainWindow = new BrowserWindow({
    width: 1280,
    height: 720,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
    },
  });

  mainWindow.loadFile('index.html');
  steamworks.electronEnableSteamOverlay();
});

TypeScript

import steamworks from "steamworks.js";

const client = steamworks.init(480);
console.log(`Welcome, ${client.localplayer.getName()}`);

4. Development Setup

steam_appid.txt

Create a file named steam_appid.txt in your project root:

480

Add it to .gitignore to keep it out of version control.


5. Verification

const steamworks = require('steamworks.js');

const client = steamworks.init(480);
console.log('Steam initialized ✓');
console.log('Player:', client.localplayer.getName());

If valid info prints out, your setup is working correctly.

Clone this wiki locally