This how-to walks you through configuring Sign in with Google and starting a Google session from your game.
Prerequisites
- Unity, Unreal, or Godot SDK installed and configured in your project (not required for REST).
- A Google account with access to the Google Cloud Console to create an OAuth2 Client ID.
Configuration
Configure your integration in the platform settings.

Client ID: retrieve this from the Google Dev Console. Create an OAuth2 Client ID if you don't already have one.
Start Session
Acquire a Google Identity Token, then use it to start a session. The response includes a refresh token, which lets you refresh the session without repeating the full sign-in flow.
string idToken = "eyJhbGciOiJSUz............";LootLockerSDKManager.StartGoogleSession(idToken, (response) =>{ if (!response.success) { Debug.Log("error starting LootLocker session");
return; }
Debug.Log("session started successfully");
// Store these to be able to refresh the session without using the full sign in flow string refreshToken = response.refresh_token;});
Input
Exchange the TriggerGoogleSignIn event for whatever event should trigger the login flow. Remove the REPLACE: Google ID Token node and replace it with your preferred method of getting the Google Identity Token.
Output
Branch the completed events on the success flag, and add error handling for the failure case. Create variables from the Player ID and Player Identifier outputs for subsequent LootLocker calls. The session response also includes a refresh token (saved automatically, but available if you want to manage it manually), along with other fields such as current XP and level.
Coming soon — this sample hasn't been written yet.
curl -X POST "https://api.lootlocker.io/game/session/google" \ -H "LL-Version: 2021-03-01" \ -H "Content-Type: application/json" \ -d "{\"game_key\": \"your_game_key\", \"id_token\": \"eyJQa....\", \"game_version\": \"1.0.0.0\" }"Example response:
{ "session_token": "eb13a7bf17efg36cb8481a8ds18809c7e85686e6", "player_id": 9358, "public_uid": "J72YP6MS", "player_name": null, "player_created_at": "2023-02-21T15:33:25+00:00", "check_grant_notifications": false, "check_deactivation_notifications": false, "seen_before": true, "refresh_token": "eyJh............................."}Refresh Session
Refresh the session instead of having the player go through the full sign-in flow every time. The request returns a 401 (Unauthorized) if the refresh token has expired, in which case start a new session instead.
LootLockerSDKManager.RefreshGoogleSession((response) =>{ if (!response.success) { if (response.statusCode == 401) { // Refresh token has expired, use StartGoogleSession } else { Debug.Log("error starting LootLocker session"); }
return; }
Debug.Log("session started successfully");});
Input
Exchange the TriggerSessionRefresh event for whatever event should trigger the login flow. The Refresh Token node is the one you saved when starting a session, but it's optional since LootLocker saves it automatically.
Output
Branch the completed events on the success flag, and add error handling for the failure case. Create variables from the Player ID and Player Identifier outputs for subsequent LootLocker calls.
Coming soon — this sample hasn't been written yet.
curl -X POST "https://api.lootlocker.io/game/session/google" \ -H "LL-Version: 2021-03-01" \ -H "Content-Type: application/json" \ -d "{\"game_key\": \"your_game_key\", \"refresh_token\": \"748b....\", \"game_version\": \"1.0.0.0\" }"Example response:
{ "session_token": "eb13a7bf17efg36cb8481a8ds18809c7e85686e6", "player_id": 9358, "public_uid": "J72YP6MS", "player_name": null, "player_created_at": "2023-02-21T15:33:25+00:00", "check_grant_notifications": false, "check_deactivation_notifications": false, "seen_before": true, "refresh_token": "eyJh............................."}Conclusion
You've started using LootLocker in your game with Sign in with Google. Next, review LootLocker's full feature set to decide which other features to implement.