I assume your goal here is to sell your Twine game on Steam, and to support Steam achievements.
To do that, you’ll have to build an Electron app, and use something like Greenworks to integrate with it. Greenworks is no longer supported as of 2022, but https://github.com/ceifa/steamworks.js looks pretty compelling.
Creating and building an Electron app can be pretty daunting. You might start by availing yourself of Emilia Lazer-Walker’s Twine App Builder. https://github.com/lazerwalker/twine-app-builder The Twine App Builder doesn’t integrate with Greenworks or steamworks.js out of the box, but if you’re an experienced JavaScript developer, it seems plausible that you could integrate steamworks.js with Twine App Builder with some hard work.
(If you did it, I bet Emilia would be happy to accept a pull request to add Steam support to Twine App Builder.)
As for Story Formats, Snowman is specifically designed to let you write arbitrary JavaScript. If you had a working Twine App Builder that supported steamworks.js, you could use Snowman templates like this:
<%
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')) {
// ...
}
%>
Notably, the Steamworks Web API is probably not what you want. In that API, you’d have to operate a web server that can accept web requests. On that server, you’d store a secret key that you’d use to authenticate with Steam. With that set up, your Steam game could contact your web server, send the user’s Steam ID to your web server, and then have your web server use the SetUserStatsForGame
API to register an achievement.
But to do that, you’d need to get the user’s numeric Steam ID, which, itself, would require you to integrate with Steamworks. At that point, you might as well just activate the achievement yourself, rather than incorporating an unnecessary web server.