LogoPixi’VN

Steam

How to integrate Steam into your game using the built-in Tauri + Steamworks support included in this template.

Mobile

Steam is not supported on iOS or Android — the feature is automatically disabled on those targets.

The multiplatform template includes a ready-to-use Steam integration built on Tauri and the Rust crate steamworks (a wrapper around the Steamworks SDK). Everything is opt-in: the feature is excluded from the build by default and adds zero overhead when unused.

Enabling Steam support

Edit steam_appid.txt in the repo root and replace the value with your real Steam App ID.
Use 480 (Spacewar) for local testing without a published app.

steam_appid.txt
480

Open src-tauri/Cargo.toml and add steam to the default features list:

src-tauri/Cargo.toml
default = ["steam"]

Alternatively, pass --features steam to any cargo or tauri build command without touching the file.

The steamworks Rust crate already ships the native redistributable libraries for all platforms — nothing to download manually. The build.rs in this template copies the correct file into src-tauri/ automatically during compilation.

Bundling for distribution

To include the library in the final installer you need to tell Tauri to bundle it. Create a platform-specific config file for the platform you are targeting — you only need the one(s) that apply to you:

src-tauri/tauri.windows.conf.json
{
    "bundle": { "resources": ["steam_api64.dll"] }
}

Tauri v2 merges the matching file into tauri.conf.json automatically at build time. Create only the files for the platforms you want to distribute on — one, two, or all three.

API

Import the steam namespace from @/lib/steam and call any function directly.
All functions are safe to call even when Steam is unavailable or the app runs in a browser: they simply return null / false / 0 without throwing.

Base implementation

For reference, the base implementation is located in src-tauri/src/steam.rs and the API is exposed to the frontend via Tauri's invoke system in src-tauri/src/lib.rs.

[features]
default = []          # change to ["steam"] to enable
steam = ["dep:steamworks"]

[dependencies]
steamworks = { version = "0.13", optional = true }

On this page