feat(audience): auto-collect Steam user ID and detect Steam platform#798
Merged
Conversation
When Steamworks.NET or Facepunch.Steamworks is present, the SDK now: - Calls Identify() with the logged-in SteamID64 automatically at Init - Sets distribution_platform = "steam" in game_launch properties Detection uses C# reflection so there is no hard compile-time dependency; games without Steamworks are completely unaffected. All four Steamworks install methods are supported: - UPM via OpenUPM (com.rlabrecque.steamworks.net) - Precompiled .dll plugin (assembly name Steamworks.NET) - Source files compiled into Assembly-CSharp - Facepunch.Steamworks DLL plugin (platform-specific assembly names) link.xml entries for all Steamworks assemblies ensure IL2CPP does not strip the types the SDK reaches via reflection. Entries for absent assemblies are silently ignored, so non-Steam games are unaffected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0bb49e2 to
71ae613
Compare
bkbooth
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
When a game initialises the Audience SDK, it now automatically:
Identifywith the logged-in Steam user's SteamID64 — only if initial consent isFulldistribution_platform = "steam"in thegame_launchevent propertiesNo code changes required from the game developer — it just works.
How detection works
The SDK resolves Steamworks types at runtime via C# reflection, so there is no compile-time dependency on any Steamworks library. Games without Steam are completely unaffected.
Four install methods are handled transparently:
com.rlabrecque.steamworks.net)com.rlabrecque.steamworks.net.dllpluginSteamworks.NETAssets/Assembly-CSharpFacepunch.Steamworks.Posix/Win64/Win32All four variants were tested end-to-end against a live Steam session and verified.
Distribution platform override
Auto-detection sets
distribution_platform = "steam"only when Steam is active at launch. If the developer explicitly setsconfig.DistributionPlatform, their value takes precedence — auto-detection runs first, then the config override wins.A few things worth noting
Consent — Steam
Identifyonly fires when the SDK is initialised withFullconsent. If the game starts withAnonymousconsent and later upgrades viaSetConsent(Full), the auto-identify does not re-run; the developer should callIdentifythemselves at that point, same as for any other identity source.Facepunch.Steamworks —
SteamClient.Init(appId)must be called by the game before the SDK initialises (the SDK cannot call it because the appId is unknown). For Steamworks.NET variants, the SDK callsSteamAPI.Init()itself so it works even if the game hasn't done it yet.IL2CPP stripping — The SDK uses reflection to reach Steamworks types, which are invisible to the IL2CPP linker.
link.xmlpreservation entries are added for all known Steamworks assembly names; entries for absent assemblies are silently ignored, so non-Steam games are not affected.No Steam, no impact — If no Steamworks assembly is found the feature is a no-op. Zero overhead on non-Steam platforms.