Back to Writing
NOTESplayfabcsharpvs-codegame-backend

PlayFab — C# SDK Setup in VS Code

May 20, 2021Updated Feb 17, 2026

Using the PlayFab SDK in VS Code with C#:

  1. Install the PlayFab SDK from NuGet
  2. Create a PlayFab account and get your Title ID
  3. Use the SDK in your C# project

Example:

using PlayFab;
using PlayFab.ClientModels;

PlayFabSettings.staticSettings.TitleId = "YOUR_TITLE_ID";

var request = new LoginWithCustomIDRequest {
CustomId = "player123",
CreateAccount = true
};

PlayFabClientAPI.LoginWithCustomID(request, OnSuccess, OnError);

void OnSuccess(LoginResult result) {
Debug.Log("Login successful");
}

void OnError(PlayFabError error) {
Debug.Log("Error: " + error.GenerateErrorReport());
}