npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tauri-plugin-steamworks-api

v0.1.0

Published

Full [Steamworks SDK](https://partner.steamgames.com/doc/sdk) integration for [Tauri](https://tauri.app) v2 — **usable entirely from JavaScript** without writing Rust code.

Readme

tauri-plugin-steamworks

Full Steamworks SDK integration for Tauri v2 — usable entirely from JavaScript without writing Rust code.

Features

| Module | API | |---|---| | Init | init(appId), shutdown(), isRunning() | | User | getUserId(), getUserName(), getUserLevel(), getUserAvatar() | | Friends | getFriends(), getFriendCount(), getFriendGame(), requestUserInformation() | | Overlay | activateGameOverlay(), activateGameOverlayToWebPage(), activateGameOverlayToStore(), isOverlayEnabled(), isOverlayActive() | | Overlay Surface | activateOverlay(), setupOverlayForwarding() — Shift+Tab support via tauri-plugin-steam-overlay-surface (feature-gated) | | Achievements | setAchievement(), clearAchievement(), getAchievement(), getAchievements(), getAchievementIcon(), getNumAchievements() | | Stats | setStatInt(), setStatFloat(), getStatInt(), getStatFloat(), storeStats(), resetAllStats() | | Rich Presence | setRichPresence(), clearRichPresence(), getRichPresence() | | Leaderboards | findOrCreateLeaderboard(), findLeaderboard(), uploadScore(), downloadScores(), getLeaderboardEntryCount() | | Lobbies | createLobby(), joinLobby(), leaveLobby(), getLobbyData(), setLobbyData(), getLobbyMembers(), getLobbyMemberData(), setLobbyType(), setLobbyJoinable() | | Input | getNumAttachedDevices(), getControllerBindingConfiguration(), isUsingSteamInput(), activateActionSet(), getAnalogActionData(), getDigitalActionData() | | Remote Storage | getFileCount(), fileExists(), getFileSize(), fileWrite(), fileRead(), fileDelete() | | UGC/Workshop | getUgcNumSubscribedItems(), getUgcSubscribedItem(), updatePublishedFile(), createQueryUgc() | | Screenshots | takeScreenshot(), isScreenshotHooked() | | Utils | getAppId(), getUiLanguage(), getIpCountry(), getSystemTime(), getSecondsSinceAppActive() | | Auth | sendAuthSessionTicket(), getAuthTicketForWebApi(), cancelAuthTicket(), beginAuthenticationSession(), endAuthenticationSession() |

Prerequisites

  1. Steamworks SDK — place steam_api64.dll (Windows) / libsteam_api.so (Linux) / libsteam_api.dylib (macOS) next to your binary
  2. Steam client running — the plugin requires the Steam client to be active
  3. Valid AppID — your Steam App ID (not Spacewar 480 for production)

Installation

1. Rust crate

cd src-tauri
cargo add tauri-plugin-steamworks

Or manually in src-tauri/Cargo.toml:

[dependencies]
tauri-plugin-steamworks = "0.1"

With overlay (Shift+Tab) support:

[dependencies]
tauri-plugin-steamworks = { version = "0.1", features = ["overlay"] }

If you use the plugin from a local path (monorepo / development):

[dependencies]
tauri-plugin-steamworks = { path = "../tauri-plugin-steamworks", features = ["overlay"] }

2. Tauri plugin registration

In src-tauri/src/lib.rs:

pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_steamworks::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

With overlay (Shift+Tab) support, chain the overlay plugin:

pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_steamworks::init())
        .plugin(tauri_plugin_steamworks::init_overlay())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

3. JavaScript/TypeScript package

npm install tauri-plugin-steamworks-api

Or point directly to the guest-js/ folder.

4. Permissions

In src-tauri/capabilities/default.json, add:

{
  "permissions": [
    "steamworks:default"
  ]
}

Usage (JavaScript)

import * as Steam from 'tauri-plugin-steamworks-api'

// Initialize Steam (call once on app start)
await Steam.init(480) // your App ID

// Check if running
console.log('Steam running:', await Steam.isRunning())

// User info
const userId = await Steam.getUserId()
const name = await Steam.getUserName()
const level = await Steam.getUserLevel()

// Friends
const friends = await Steam.getFriends()
console.log(friends)

// Achievements
await Steam.setAchievement('FIRST_BLOOD')
const achievements = await Steam.getAchievements()

// Rich Presence
await Steam.setRichPresence('status', 'In Main Menu')
await Steam.setRichPresence('steam_display', '#StatusMenu')

// Leaderboards
const lb = await Steam.findOrCreateLeaderboard('Score', 1, 1, 10)
await Steam.uploadScore('Score', 12345, 1)

// Lobbies
const lobby = await Steam.createLobby(3, 4) // Public, 4 players
await Steam.setLobbyData(lobby.lobbyId, 'name', 'My Lobby')
const members = await Steam.getLobbyMembers(lobby.lobbyId)

// Overlay
await Steam.activateGameOverlay('friends')
await Steam.activateGameOverlayToWebPage('https://example.com')

// Cloud saves
await Steam.fileWrite('save.json', Array.from(new TextEncoder().encode(JSON.stringify({score: 100}))))
const data = await Steam.fileRead('save.json')

// Stats
await Steam.setStatInt('kills', 42)
const kills = await Steam.getStatInt('kills')

// Screenshots
await Steam.takeScreenshot()

// Shutdown when done
await Steam.shutdown()

Architecture

┌──────────────────────────────────────────────────────────────────┐
│  JavaScript (frontend)                                           │
│  import * as Steam from 'tauri-plugin-steamworks-api'            │
│                                                                  │
│  Steam.init(480)  →  invoke('plugin:steamworks|steam_init', ...) │
└─────────────────────────────┬────────────────────────────────────┘
                              │ Tauri IPC
┌─────────────────────────────▼────────────────────────────────────┐
│  Rust plugin (tauri-plugin-steamworks)                           │
│                                                                  │
│  Static STEAM_CLIENT (Mutex<Option<steamworks::Client>>)         │
│  Background thread: callback pump (100ms interval)                │
│                                                                  │
│  All commands access the static client directly                   │
│  No state management, no AppHandle dependency                     │
└──────────────────────────────────────────────────────────────────┘
                              │
┌─────────────────────────────▼────────────────────────────────────┐
│  steamworks-rs  →  Steamworks SDK (steam_api64.dll)              │
└──────────────────────────────────────────────────────────────────┘

Important Notes

  • Overlay (Shift+Tab): Enable the overlay feature to get built-in Shift+Tab support via tauri-plugin-steam-overlay-surface. This creates a transparent decoy swapchain that Steam hooks into. In your frontend, call setupOverlayForwarding() after init() to forward Shift+Tab to Steam:
    import { init, setupOverlayForwarding } from 'tauri-plugin-steamworks-api'
    await init(480)
    setupOverlayForwarding()
  • Thread safety: The plugin uses a background thread for Steam callbacks. All Tauri commands access the client via Mutex.
  • Windows: steam_api64.dll must be next to your .exe. Get it from the Steamworks SDK redistributable_bin/ folder.
  • Linux: libsteam_api.so must be in the library path or next to the binary.

Limitations

  • Achievement notification toasts: Steam's visual "Achievement Unlocked" popup plays its sound but does not display visually. This is a limitation of the overlay surface approach: the decoy swapchain window is hidden when the overlay is closed, so Steam cannot composite notification toasts onto it. The sound still plays, confirming the achievement was processed.
  • Windows only (overlay surface): The overlay feature relies on tauri-plugin-steam-overlay-surface, which creates a decoy swapchain (D3D11) that Steam hooks for Shift+Tab. This only works on Windows. On Linux, Steam uses gameoverlayrenderer.so with Vulkan/OpenGL hooks, plus X11/Wayland-specific window management — the approach should translate but requires platform-specific work upstream. On macOS, Metal support would be needed and Steam overlay is largely non-functional natively. The upstream repo accepts PRs for cross-platform support.
  • Steam client required: The plugin cannot work without a running Steam client. There is no offline/mock mode.
  • steam_api64.dll placement: The Steamworks shared library must be placed next to your binary manually. It is not bundled by the plugin.
  • Thread safety: The plugin uses a background thread for Steam callbacks. All commands lock a global Mutex, so heavy concurrent access from the frontend could cause brief contention.
  • Alpha: This project is AI-assisted and early stage. APIs may change. Test thoroughly before shipping.

Warning

This project was generated with the assistance of AI. It is in an early/alpha stage and may contain bugs, incomplete implementations, or APIs that change without notice. Use it at your own risk and test thoroughly before relying on it in production. Contributions and bug reports are welcome.

Credits

License

MIT