Quickstart: PlayFab Client library for C# in Unity
Get started with the PlayFab Client library for C# in Unity. Follow steps to install the package and try out example code for a basic task. This quickstart helps you make your first PlayFab API call in the Unity engine.Requirements
- A PlayFab developer account.
- An installed copy of the Unity Editor. To install Unity for personal use via Unity Hub, or Unity+ for professional use, see Download Unity.
The PlayFab Unity SDK supports Unity Editor version 5.3 (released December 2015) and higher.
- A Unity Project of any of the following types:
- A brand new project. For more information, see Starting Unity for the first time.
- A guided tutorial project. For more information, see Getting Started with Unity.
- An existing project.
- The PlayFab Unity SDK.
Download and install PlayFab SDK
Either use the PlayFab Editor Extensions package to install the SDK or install the SDK directly. The PlayFab Editor Extensions are a stand-alone Unity plug-in that streamlines installing the SDK and configuring some PlayFab settings for your Title. For information about installing the SDK without using the PlayFab Editor Extensions, see Installing the PlayFab SDK Without Editor Extensions for Unity.- Download the PlayFab Unity Editor Extensions Asset Package.
- Open your Unity Project.
-
Navigate to where you downloaded the file and double-click on the
PlayFabEditorExtensions.UnityPackagefile to open the Import Unity Package dialog in the Unity Editor.
- To import the PlayFab Unity Editor Extensions into your project, select Import.
- When the import completes, the PlayFab Unity Editor Extensions panel should open automatically displaying the SDK installation dialog.
If the panel did not open, or if you close the panel and want to reopen it, you can do so by selecting Window > PlayFab > Editor Extensions

Set your title settings
Before you can make an API call, you must create a PlayFabSharedSettings.asset and specify the Title ID to receive the call. To set the Title ID:- Select PlayFab > MakePlayFabSharedSettings which should create the settings asset and open it in the Inspector panel.
-
Set your Title ID in the inspector.

- Now at any time, you may also see and change the current Title ID from the Settings tab in the Editor Extensions panel.

The extensions allow you to customize the HTTP transport used to make requests to PlayFab. The recommended default is Unity Web Request. Other options exist to provide compatibility with older engine versions or game-specific HTTP implementations.
Making your first API call
This part of the guide provides the minimum steps to make your first PlayFab API call. This example doesn’t provide any GUI or on-screen feedback. Confirmation is displayed in the Console log.- If your Unity Project doesn’t already have a Scripts folder (HDRP and LWRP/URP templates have one by default), right-click on the Assets folder in the Project panel and select Create > Folder.
- In the Assets window, name the folder Scripts.
- Right-click the Scripts folder and select Create > C# Script.
- Name the script PlayFabLogin.
- Double-click the file to open it in a code-editor.
-
In your code editor, replace the contents of PlayFabLogin.cs with the provided code and save the file.
The provided code is not for use with mobile Titles. This is only an example, and shows how to log in with a
CustomID. To implement login for a mobile Title, use eitherFinish and execute
You’re now ready to test out this sample.- Be sure to save all files and return to the Unity Editor
- Press the Play button at the top of the editor

