Docs · 03
Unity SDK
The Unity package com.gameway.sdk: the signed-in user, friends, presence, invites, launch tickets and the in-game overlay.
4 min readUpdated 4 Oct 2026
Documentation sections
The overlay, friends, invites and online passes work end to end with the current app; Tactical Ops ships with them. The names on this page are the ones in the package today; read the changelog of the version you are given for what changed.
Requirements
- Unity 6000.6. Older versions have not been tested.
- The Input System package 1.20.0 and the UI Toolkit module (the package lists both as dependencies).
- C# 9 and .NET Standard 2.1, Mono or IL2CPP, managed code stripping at Minimal.
- Desktop players: macOS (universal), Windows (x64) and Linux (x64). Dedicated servers: Linux (x64).
Install
- Add the package
com.gameway.sdkto your project: Window, Package Manager, +, Add package from tarball… and choose the file you were given, or add"com.gameway.sdk": "file:<path>/com.gameway.sdk"toPackages/manifest.jsonfor a package on disk. - Open Edit, Project Settings, Gameway. Enter the app id from the developer portal (the number next to your app's name), look at the default overlay hotkey, and press Validate.
- Build. The build checks warn about hotkey collisions and fail a build whose target has no native library.
The package carries three native libraries, one per desktop platform, that it loads by itself. Never replace them by hand: they are built together with the C# bindings, and the SDK refuses to run in a development build when the two disagree.
Start and stop
Initialise once, from the main thread, when your game starts. Everything below must be called from that same thread.
using Gameway.Sdk;
using GW = Gameway.Sdk.Gameway;
public class PlatformBootstrap : UnityEngine.MonoBehaviour
{
void Start()
{
GwResult r = GW.Init(); // the app id and options come from Project Settings
if (r == GwResult.NotLaunchedByClient)
{
// started by double-click instead of by the app: show "restart via Gameway" and offer it
bool quitNow;
GW.RestartAppIfNecessary(GW.AppId, out quitNow);
if (quitNow) UnityEngine.Application.Quit();
return;
}
if (r.IsError()) UnityEngine.Debug.LogWarning("Gameway SDK: " + r.CodeName());
GW.ConnectionStateChanged += (now, before, why) => UnityEngine.Debug.Log("connection: " + now);
GW.TicketReady += e => { byte[] ticket = e.Payload; /* hand it to your connection code */ };
}
void OnDestroy() { GW.Shutdown(); }
}Init()reads your app id from Project Settings.Init(appId)passes it yourself.NotLaunchedByClientmeans the game was started without the app. Ask the player to restart it through the app;RestartAppIfNecessarydoes that.- In the Editor the SDK runs in a developer mode that uses your own signed-in client; it never counts as an integration check on the portal.
- The package pumps its own events from the Unity player loop every frame. Your code only subscribes.
What you can call
| You want | Call |
|---|---|
| The signed-in player | GetUser(out GwUser) or TryGetUser |
| Friends and avatars | FriendCount, GetFriend, GetFriends(list), GetAvatarPath (answers Pending, then the AvatarReady event) |
| Presence | SetRichPresence(key, value), ClearRichPresence(), SetJoinable(true, connect). See Rich presence. |
| Invites and joining a friend | SendInvite, RespondToInvite, JoinFriend, GetLaunchJoinString, ParseConnect; events InviteReceived, JoinRequested, JoinInfo |
| A launch ticket for a server | RequestTicket(serverId, "<ip:port>", includeName, out id) and the TicketReady event. See Online passes. |
| Chat | RequestConversations, RequestChatHistory, SendChat, MarkChatRead and the ChatMessage event |
| Results of requests | EventReceived for every event; a request that fails raises RequestFailed |
| The overlay | Overlay.ActivatedChanged, Overlay.Hotkey, Overlay.HotkeySource. See Overlay. |
Result codes
Every call returns a GwResult. Ok and the positive values are successes (Pending means the answer comes as an event, NoData means there is nothing to return). Negative values are errors: NotInitialized, WrongThread, Offline, NotOwned, RateLimited, NotFriend, NotJoinable, Denied, the Ticket… family and Internal. CodeName() gives the stable name for your logs.
No callback ever crosses into native code and an idle SDK allocates nothing per frame, so it is safe to leave on in every frame of a shipping game.
Builds
- A dedicated-server build (
UNITY_SERVER) compiles the Runtime and Server assemblies only. The overlay is never part of it. - Headless players (
-batchmode -nographics) run without the overlay. - On macOS, if you re-sign the app yourself, sign with
codesign --deepso the library keeps a valid signature. The package can check an output with-executeMethod Gameway.Sdk.Editor.GamewayBuildChecks.VerifyMacBundleCli -gwApp <path to the .app>.
Push the result with the command line tool. Build with Unity's compression off, or every update re-downloads almost the whole game: see the store assets guide.
Samples
- NGO ticket approval: Netcode for GameObjects connection approval with launch tickets, from throttling to online redemption with a pending approval.
- Overlay demo: initialisation, pausing your input while the overlay is open, the effective hotkey, rich presence and friends.
Import them from the package's entry in the Package Manager.
Gameway · 2026-10-04