This how-to walks you through authenticating with Nintendo Switch and starting a session from your game.
Prerequisites
- Unity, Unreal, or Godot SDK installed and configured in your project (not required for REST).
- A registered Nintendo developer account.
- The Nintendo Dev Interface installed (from developer.nintendo.com), with an environment set up matching your Unity version.
- The NintendoSDK installed from that environment, along with all dependencies.
- The Nintendo Switch platform enabled in your game's settings in LootLocker, with the Nintendo Application ID matching between your editor and the LootLocker console (you can use the Nintendo default one during initial development).
Register a Session
Create a new empty GameObject in your scene named GameManager (skip this if you already have one), then add a new script to it called GameManager.

Open up your new script in your editor of choice and add the following code:
using System.Collections;using System.Collections.Generic;using UnityEngine;using LootLocker.Requests;
public class GameManager : MonoBehaviour{ void Start() { string NSAIDToken = getNSAIDToken(); LootLockerSDKManager.StartNintendoSwitchSession(NSAIDToken, (response) => { if (!response.success) { Debug.Log("error starting LootLocker session");
return; }
Debug.Log("successfully started LootLocker session"); }); }}Run your game and check the console for the success message to confirm the session started correctly.

Input
Exchange the TriggerNintendoStartSession event for whatever event should trigger the login flow. Remove the REPLACE: NSA Id Token node and replace it with your actual Nintendo Switch token.
Output
Branch the completed events on the success flag, and add error handling for the failure case.
Coming soon — this sample hasn't been written yet.
curl -X POST "https://api.lootlocker.io/game/session/nintendo-switch" \ -H "LL-Version: 2021-03-01" \ -H "Content-Type: application/json" \ -d "{\"game_key\": \"your_game_key\", \"nsa_id_token\": \"eyJQa....\", \"game_version\": \"1.0.0.0\", \"session_id\": \"8438f4b3-90e4-4cdd-8434-c5c6b4c2c9f1\"}"Example response:
{ "success": true, "session_token": "e6fa44946f077dd9fe67311ab3f188c596df9969", "player_id": 3, "public_uid": "TSEYDXD8", "player_created_at": "2022-05-30T07:56:01+00:00", "check_grant_notifications": true, "check_deactivation_notifications": false, "seen_before": true}Conclusion
You've started using LootLocker in your game with Nintendo Switch. Next, review LootLocker's full feature set to decide which other features to implement.