- Game — the SDK authenticates your game with the credentials you configure once (API Key, Game ID, Game Version). Every request it makes is then identified as your game.
- Player — players sign in through the SDK, which then manages their session automatically for the rest of play.
Configure your game
Set your credentials in your engine’s settings — Flock → Settings in Unity, Project Settings → Plugins → Flock SDK in Unreal. The editor also verifies the connection and resolves your Game Version, both required before the SDK can start (see setup for Unity or Unreal). With Auto-Initialize On Load the SDK authenticates as your game at startup; turn it off to initialize it yourself. Reach everything throughFlockClient.Instance in Unity, or UFlockSubsystem::Get(this) in Unreal.
Sign in a player
Players sign in with one of several methods. Each resolves to the same player account, and the SDK keeps them signed in afterward.Failures surface differently per engine. Unity throws
FlockException; Unreal returns a
TFlockResult you check, because Unreal builds with exceptions off. Every Unreal call is also a
Blueprint node with an On Failure pin.- Email / password
- Device ID
- Google / Apple / Steam / Facebook / Discord
RegisterWith…Async (Unity) or
RegisterWith… (Unreal) for the sign-up step.
Registering an identity that already has an account is reported as a success, flagged so you can
route the player to a login rather than show them a failure. In Unreal, Facebook and Discord are
login-only — an account must already exist.
Afterward, read FlockClient.Instance.CurrentPlayerId (Unity) or Flock Get Player Id /
GetPlayerId() (Unreal), or handle the OnAuthenticated event.
Picking a display name? Check it’s free first — advisory, since another player can still claim it
in between:
Password reset
For email/password accounts, a two-step emailed-code flow. The first call always succeeds — it never reveals whether an email is registered.Email verification
Optional, code-based, and always under your control — the SDK never sends verification emails on its own. Typically used while the player is signed in (their session is attached automatically), but neither call blocks on it.Signing out
Logout() clears the session on the device — the standard client sign-out. For shared devices or
a compromised session, RevokeTokenAsync() additionally kills the player’s session server-side,
so a stolen session token stops working:
Sessions are managed for you
Player sessions are short-lived under the hood, but the SDK refreshes them automatically — you don’t have to think about tokens or expiry. If a player needs to sign back in, the SDK raisesOnAuthExpired on its event hub.