0.0.32 • Published 4 months ago

@jamalkhan/steamworksjs v0.0.32

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Steamworksjs

A Fork of: https://github.com/ceifa/steamworks.js

API

const steamworks = require('steamworks.js')

// You can pass an appId, or don't pass anything and use a steam_appid.txt file
const client = steamworks.init(480)

// Print Steam username
console.log(client.localplayer.getName())

// Tries to activate an achievement
if (client.achievement.activate('ACHIEVEMENT')) {
    // ...
}

You can refer to the declarations file to check the API support and get more detailed documentation of each function.

Installation

To use steamworks.js you don't have to build anything, just install it from npm:

$: npm i steamworks.js

Electron

Steamworks.js is a native module and cannot be used by default in the renderer process. To enable the usage of native modules on the renderer process, the following configurations should be made on main.js:

const mainWindow = new BrowserWindow({
    // ...
    webPreferences: {
        // ...
        contextIsolation: false,
        nodeIntegration: true,
    },
})

To make the steam overlay working, call the electronEnableSteamOverlay on the end of your main.js file:

require('steamworks.js').electronEnableSteamOverlay()

How to build

You only need to build if you are going to change something on steamworks.js code, if you are looking to just consume the library or use it in your game, refer to the installation section.

Make sure you have the latest node.js, Rust and Clang. We also need Steam installed and running.

Install dependencies with npm install and then run npm run build:debug to build the library.

There is no way to build for all targets easily. The good news is that you don't need to. You can develop and test on your current target, and open a PR. When the code is merged to main, a github action will build for all targets and publish a new version.

0.0.32

4 months ago

0.3.1

5 months ago

0.0.26

5 months ago

0.0.25

5 months ago