Back to Writing
NOTESplayfabcsharpvs-codegame-backend
PlayFab — C# SDK Setup in VS Code
May 20, 2021•Updated Feb 17, 2026
Using the PlayFab SDK in VS Code with C#:
- Install the PlayFab SDK from NuGet
- Create a PlayFab account and get your Title ID
- 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());
}