Skip to main content
This guide takes you from zero to a working PlayFab authentication flow using the PlayFab Sign-In Unity sample — the simplest sample in the repository.

Prerequisites

Before you begin, make sure you have the following:
  • A free PlayFab developer account
  • Unity 2018.3 or later (download from unity.com)
  • Visual Studio 2017 (Update 15.7) or later with the Game development with Unity workload installed
  • Git installed and available on your PATH
The PlayFab Sign-In sample targets Unity 2018.3+. Newer LTS versions of Unity are fully supported.

Step 1: Create a PlayFab title in Game Manager

Every PlayFab integration is scoped to a title. You need a Title ID to connect any sample to the PlayFab backend.
1

Log in to Game Manager

Go to developer.playfab.com and sign in with your PlayFab account.
2

Create a new studio (first time only)

If this is your first title, Game Manager prompts you to create a Studio. Enter a studio name (for example, your company or team name) and select Create studio.
3

Create a new title

Inside your studio, select New title. Enter a title name such as PlayFab Sign-In Sample, then select Create title.
4

Copy your Title ID

After the title is created, Game Manager opens the title dashboard. Your Title ID appears in the top-left corner beneath the title name — it is a short alphanumeric string such as ABCD1. Copy it; you will need it in a later step.

Step 2: Clone the repository

1

Open a terminal

Open a terminal (or Git Bash on Windows) in the directory where you want to store the project.
2

Clone the repo

Run the following command:
git clone https://github.com/Myst0gan1/PlayFab-Samples.git

Step 3: Open the project in Unity

1

Launch Unity Hub

Open Unity Hub and select Open (or Add on older versions).
2

Navigate to the sample folder

Browse to the following path inside the cloned repository and select Open:
PlayFab-Samples/Samples/Unity/PlayFabSignIn
3

Allow Unity to import the project

Unity imports the project and its dependencies. This may take a few minutes on the first open. If Unity prompts you to upgrade the project to a newer version, select Continue.

Step 4: Configure your Title ID

The sample needs your Title ID to communicate with the PlayFab backend.
1

Open the PlayFabSharedSettings asset

In the Unity Project window, navigate to:
Assets/PlayFabSdk/Shared/Public/Resources/PlayFabSharedSettings.asset
Select the file to open it in the Inspector.
2

Enter your Title ID

In the Inspector, find the Title Id field and paste the Title ID you copied from Game Manager.
3

Save the project

Press Ctrl+S (Windows) or Cmd+S (macOS) to save.
You can also set the Title ID using the PlayFab Editor Extensions panel inside Unity. Select PlayFab in the menu bar, then Editor Extensions, and enter your Title ID in the Settings tab.

Step 5: Run the scene

1

Open the main scene

In the Project window, navigate to Assets/Scenes and double-click the main scene file to open it.
2

Press Play

Select the Play button at the top of the Unity Editor.
3

Sign in

The sample presents a sign-in dialog with three options:
  • Sign in with email and password — use credentials from an existing PlayFab account linked to your title.
  • Create an account — register a new email/password account. The sample silently authenticates via device ID first, then links the email/password to that account.
  • Sign in as guest — authenticates silently using the device’s unique identifier via LoginWithCustomID (on desktop) or the platform-native device ID API (on Android or iOS).
Enable Remember me to skip this dialog on subsequent runs.
4

Confirm a successful login

After a successful sign-in, the screen transitions to a post-login view. You can select Clear sign-in to sign out, or Clear remembered login to remove stored credentials.To verify the login server-side, open your title in Game Manager and select Players from the left navigation — the signed-in player should appear in the list.
The sign-in logic lives in Assets/Scripts/PlayFab/PlayFabAuthService.cs. It supports email/password, guest (silent), and account registration flows through a single Authenticate(Authtypes) entry point. The UI is handled separately in Assets/Scripts/UI/LoginWindowView.cs.

What to try next

Now that you have a working sign-in flow, explore more complex samples and recipes:

PlayFab Sign-In (deep dive)

Full reference for the Sign-In sample, including the auth service architecture and UI wiring.

Space Rumble

A complete mini-game covering leaderboards, CloudScript, and player events on top of authentication.

Progressive Rewards

Reward players for consecutive daily logins using CloudScript and Title Data.

Recipes overview

Browse all drop-in mechanics — prize wheels, referral codes, regenerating currency, and more.

Build docs developers (and LLMs) love