> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manalens.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Link Steam in 2 minutes

> Turn on the Steam link in your game: Steam ownership on each player, and one player for all installs of one Steam account.

A Steam link proves which Steam account plays your game. The player does not sign in. Manalens then shows [Steam ownership](https://docs.manalens.dev/features/steam-ownership.md) on the player and joins the game installs of one Steam account into one player.

## 1. Add your Steam Web API key

1. In [Steamworks](https://partner.steamgames.com/), open **Users & Permissions**, then **Manage Groups**. Create a group with only the apps of this game. Select **Create WebAPI Key** and tick only **General**. Copy the key.
2. In Manalens, open **Settings**, **Integrations**, **Steam** (the [Connect Steam card](https://docs.manalens.dev/integrations/steam.md#connect-the-steam-keys-optional)). Paste the key and select **Save key**. Then choose your game and select **Save App ID**. You need the owner or admin role and a verified MFA session.

## 2. Turn on the link in your game

The SDK links once per launch, after consent. It waits until the first event batch of the launch is accepted, plus 20 seconds, so that Manalens has stored the install's events first. Manalens joins installs only when the install has its own events before a link (see [why](#why-the-link-waits-for-the-first-events)).

> [tab] Godot
>
> Install [GodotSteam](https://godotsteam.com) and start Steam in your game. Then set `steam_link`:
>
> ```gdscript theme={null}
> Manalens.init({
>     "publishable_key": "mana_pk_...",
>     "storefront": "steam",
>     "steam_link": true,
> })
> ```
>
> Or turn on **Steam Link** in **Project Settings > Manalens** (Advanced Settings). Needs SDK 0.6.0 or later. See [Godot](https://docs.manalens.dev/sdks/godot.md#verify-steam-ownership).

> [tab] Unity
>
> Install [Steamworks.NET](https://github.com/rlabrecque/Steamworks.NET) and call `SteamAPI.Init()` in your game. Then set `SteamLink = true` in the Manalens options. Needs SDK 0.6.0 or later. See [Unity](https://docs.manalens.dev/sdks/unity.md#verify-steam-ownership).

> [tab] Unreal
>
> Enable the **Online Subsystem Steam** plugin and set Steam as the platform service in `Config/DefaultEngine.ini`:
>
> ```ini theme={null}
> [OnlineSubsystem]
> DefaultPlatformService=Steam
>
> [OnlineSubsystemSteam]
> bEnabled=true
> SteamDevAppId=480
> ```
>
> Then turn on **Steam Link** in **Project Settings > Plugins > Manalens** (category Steam). Needs plugin 0.6.0 or later. See [Unreal](https://docs.manalens.dev/sdks/unreal.md#verify-steam-ownership).
>
> On macOS, Unreal signs a packaged game with an App Sandbox by default. In the sandbox, the Steam API cannot find the Steam client, and a Shipping build cannot send events at all. Set `PremadeMacEntitlements` and `ShippingSpecificMacEntitlements` to an entitlements file without the sandbox. See [macOS builds and the App Sandbox](https://docs.manalens.dev/sdks/unreal.md#macos-builds-and-the-app-sandbox).

> [tab] Web and Electron
>
> Get a Steam Web API ticket with the identity `manalens` (for example with steamworks.js in Electron), then pass it as hex. Call it after your first events were sent:
>
> ```ts theme={null}
> const result = await analytics.link({ provider: 'steam', ticket: ticketHex });
> ```
>
> See [Web](https://docs.manalens.dev/sdks/web.md#verify-steam-ownership).

> [tab] Node and API
>
> Your game makes the ticket with `GetAuthTicketForWebApi("manalens")` and sends it to your server. The server links it with the secret key and may send your user ID:
>
> ```ts theme={null}
> await analytics.link({ provider: 'steam', ticket: ticketHex, anonymousId: installId, userId: 'player_123' });
> ```
>
> Without an SDK, call [`POST /v0/link`](https://docs.manalens.dev/api/link). See [Node](https://docs.manalens.dev/sdks/node.md#verify-steam-ownership).

## 3. Check that it works

1. Start the game from Steam and play for about 30 seconds.
2. Open **Players**. The player has a **Steam** badge next to the name. The profile shows the **Steam** card with the apps the account owns.
3. To see all linked players, filter **Players** by the label **Steam verified**.

The badge and the Steam card come right after the link. Two installs of one Steam account (for example a desktop and a Steam Deck) become one player within about 5 minutes.

If nothing shows: check that the Steam client runs and is signed in, that a macOS build is not in the App Sandbox (Unreal: see [macOS builds](https://docs.manalens.dev/sdks/unreal.md#macos-builds-and-the-app-sandbox)), that the player gave consent (when you ask for it), and the link answer (`steam_linked` in Godot, `SteamLinked` in Unity, **On Steam Linked** in Unreal). `STEAM_NOT_CONNECTED` means the key or the App ID is missing in step 1.

## Privacy notice

Add a line such as: "The game sends a Steam ticket to Manalens to confirm your Steam account and which of our games you own."

## Why the link waits for the first events

Anyone can send a valid ticket for their own Steam account with your public key. So Manalens joins an install to a Steam account only when the install has its own events from before a link, or when your server sent the link with the secret key. An install that linked before its first events were stored joins at its next link (for example the next launch). The SDKs wait for the first accepted batch, so the first launch already counts. If you link by hand, link after your first events were sent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.