Skip to main content
Flock authentication has two layers, and the SDK handles both:
  1. 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.
  2. 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 the Qwacks → Flock window (saved to Assets/Resources/FlockConfig.asset), where the editor also verifies the connection and resolves your Game Version — both required before the SDK can start (see setup). With Auto-Initialize On Load the SDK then authenticates as your game at startup; turn it off to call FlockClient.Create yourself. Either way, reach everything through FlockClient.Instance.

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. Auth methods throw on failure.
await FlockClient.Instance.Authentication.LoginWithEmailAsync(email, password);
The first sign-in registers the player automatically — there’s no separate sign-up step (explicit RegisterWith…Async methods also exist). Read FlockClient.Instance.CurrentPlayerId or handle FlockEvents.OnAuthenticated afterward.

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 raises FlockEvents.OnAuthExpired.
Auth methods throw FlockException on failure — wrap sign-in in try/catch so you can show a clean retry path (bad credentials, offline, etc.).