Skip to content

Today I learned

How do I call Steamworks from a Vue + Electron game and get the overlay?

A Vue game in Electron can't talk to Steam on its own: steamworks.js is a native Node module, and the Steam overlay doesn't appear over Chromium's window by default.

Keep Steam in the main process and give Vue a small API through the preload script:

js
// main.js
const steamworks = require('steamworks.js')
const client = steamworks.init(2757440) // your App ID

ipcMain.handle('steam:unlock', (_e, id) => client.achievement.activate(id))
ipcMain.handle('steam:name', () => client.localplayer.getName())

steamworks.electronEnableSteamOverlay() // last line of main.js
js
// preload.js
contextBridge.exposeInMainWorld('steam', {
  unlock: id => ipcRenderer.invoke('steam:unlock', id),
  name: () => ipcRenderer.invoke('steam:name'),
})

In a Vue component it is then just await window.steam.unlock('FIRST_CARD'). The renderer keeps contextIsolation on, so you don't need the nodeIntegration: true shortcut from the README. When you package, unpack the .node binary from the asar (asarUnpack: ['**/*.node'] in electron-builder), or require fails in the shipped build only.

What I saw: everything worked in dev, the overlay never showed up, and it turned out electronEnableSteamOverlay() was missing. It adds the Chromium flags the overlay needs to hook the window.

Source: steamworks.js, Electron section

Share LinkedIn Post on X

Related notes

Newsletter

Occasional notes on engineering, game tech, and new tools — no spam, unsubscribe anytime.

Ravy

Engineering manager, founder, and software developer building web platforms, game systems, real-time services, and automation tools. 15 years of shipped work — currently at Gaijin.net.

Get in Touch

Building an MVP, shipping a game feature, or automating a team workflow? Open source or paid — let's talk.

Contact Me
© 2020-2026 XPLOIT FZE. All trademarks, names and logos belong to their respective copyright holders.