Vapour
Type-safe Gleam bindings for the Steamworks SDK via steamworks-ffi-node.
Features
- Core API - Initialize Steamworks, manage callbacks, check connection status
- Achievements - Unlock/lock achievements, list all achievements (async with Promises)
- Cloud Storage - Save/load files to Steam Cloud, manage cloud settings
- Rich Presence - Set player status visible to friends
- Overlay - Open Steam overlay dialogs (friends, achievements, store, web pages)
- Stats - Track player statistics, get/set int and float stats, global stats, user stats, average rate stats (async with Promises)
- Friends - Get friends list, check online status, view friend info, relationship status, coplay features
- Leaderboards - Find leaderboards, upload scores, download entries (async with Promises)
Installation
Add to your gleam.toml
:
[dependencies]
vapour = { git = "https://github.com/renatillas/vapour.git", tag = "v0.1.0" }
gleam_javascript = "~> 1.0"
Add to your package.json
:
{
"dependencies": {
"steamworks-ffi-node": "^0.5.3"
}
}
Key Concepts
Callbacks
Call vapour.run_callbacks(client)
regularly (every frame or every 100ms) to process Steam events.
Achievements are Async
Achievement functions return Promises. Use gleam/javascript/promise
to handle them:
use success <- promise.await(vapour.unlock_achievement(client, "MY_ACHIEVEMENT"))
io.println("Result: " <> bool.to_string(success))
promise.resolve(Nil)
Cloud Storage
Steam Cloud must be enabled for your app and the user’s account. Check with:
let enabled = vapour.cloud_enabled_for_account(client)
Documentation
All functions are fully documented with examples. Use your editor’s autocomplete or see the source code for detailed documentation.
Example Project
See the examples
directory for a complete demo that tests all functionality:
cd examples
gleam build
gleam run
Note: You need Steam running and the Spacewar app (AppID 480) for testing.
Requirements
- Gleam >= 1.0.0
- Node.js >= 18.0.0
- Steam running on your machine
- steamworks-ffi-node ^0.5.3
License
MIT License - see LICENSE for details.
Important: While Vapour is MIT licensed, using the Steamworks SDK requires compliance with the Steamworks SDK License Agreement. You must be a registered Steam developer to use Steamworks in production.
Credits
- Built with Gleam
- Bindings for steamworks-ffi-node by Artur Khutak
Made with ✨ by Renata Amutio