Getting started¶
On this page
PlayFab Hub requires a PlayFab account/title and the separately installed PlayFab Unity SDK. PlayFab and optional Azure/platform services may charge for usage; review pricing and terms. The package does not include a hosted backend.
Installation¶
Asset Store validation¶
Complete SDK installation, accept Unity's registry dependency import, and import TMP Essential Resources in the project being validated. A newly created validation project does not inherit SDK installations from another project. Before these steps, dependency-gated sample scripts can appear as missing components. This is not a usable demo state.
After setup, Asset Store Tools 12 can report two advisory checks: the default UI Toolkit theme's generated Font Material uses Unity's GUI/Text Shader, which lacks the URP/HDRP tags checked by the validator; and static fields/events are reported without examining their reset logic. The Hub resets runtime session state through SubsystemRegistration and clears event subscriptions on shutdown. These advisories do not replace testing the configured render pipeline and application lifecycle. The package does not suppress validator results.
The shipped UI Toolkit Login demo's text and controls were visually verified in Unity 6000.4.6f1 with URP 17.4.0. This check does not claim HDRP validation.
Open Tools > MoDev > PlayFab Hub > Setup and Help to download the tested SDK from Microsoft's PlayFab GitHub repository. Import the downloaded file through Assets > Import Package > Custom Package, reviewing existing SDK files/settings before import. PlayFab Hub does not programmatically install other products. The Asset Store archive includes Unity Package Manager dependency metadata: accept Unity's dependency prompt for uGUI (including TMP on Unity 6) or uGUI and TMP on Unity 2022.3. Import Window > TextMeshPro > Import TMP Essential Resources, then wait for compilation before validating the demos. Use the archive exported for your Unity version; registry dependency versions differ between Unity 2022.3 and Unity 6.
Tested SDK: UnitySDK-2.230.260123 from PlayFab/UnitySDK, using its PlayFab and PlayFabSDKEditor assemblies. Tested editors: Unity 2022.3.44f1 and Unity 6000.4.6f1. Other SDK generations/editor releases require your own compatibility check.
For the Asset Store .unitypackage, import the whole Assets/PlayFabHub folder. For UPM, install com.modev.playfabhub as an embedded/local package. Use one installation route per project to avoid duplicate GUIDs/types. Without PlayFab, only the dependency-free Setup and Help window compiles. After SDK import, allow the automatic define update and recompilation to complete.
The main Hub does not require TextMeshPro. To generate all six samples, install uGUI and TextMeshPro using Window > Package Manager: on Unity 2022.3 use uGUI 1.0.0 plus TextMeshPro 3.0.6; on Unity 6 use uGUI 2.0.0, which includes TMP. Import TMP Essential Resources through Window > TextMeshPro > Import TMP Essential Resources before generation. No package is installed programmatically. UPM declares uGUI; the Asset Store archive declares the registry dependencies for its Unity version. Accept the dependency prompt or install the matching packages manually.
First scene¶
- Open Tools > MoDev > PlayFab Hub > Hub and create the settings asset under
Assets/PlayFabHub/Resources. - Configure your Title ID in Advanced and enable the required features. No title/secret/settings instance ships with the package.
- Open the six saved scenes under
Assets/PlayFabHub/Samplesfor an Asset Store import. Generation is optional. For UPM, import the samples or generate scenes through Tools > MoDev > PlayFab Hub > Generate Sample Scenes. For UPM this provisions the sample sources; an Asset Store import already contains visible sources underAssets/PlayFabHub/Samples. There is no ZIP extraction step. Import TMP Essential Resources if Unity prompts. - Open the Login scene, enter Play mode, and register or log in with a test email account. See authentication before using guest login on a new title.
- Open the leaderboard/shop scene in the same running session, or have your game perform login first. Auto guest login is disabled by default. Publish a v2 catalog/price and provision test balances before exercising shop purchases; set the leaderboard statistic name to one on your title.
A disabled/missing manager displays a setup message when a sample action is clicked. Samples do not enable features, change title policy, or grant balances automatically. Example UIs are starting points to customize, not a complete game account/shop system.
Configure your PlayFab title¶
Follow PlayFab feature setup for every enabled feature before testing it. It covers API Features, client profile permissions, catalogs/prices, receipt mapping, handlers, groups, LiveOps, push and matchmaking. In particular, ClientDirect leaderboard writes require both the Hub write-authority setting and Allow client to post player statistics in Game Manager. Reads and server-written scores do not require that permission.
Game code¶
using MoDev.PlayFabHub;
PlayFabHub.Initialize();
if (PlayFabHub.Auth != null)
PlayFabHub.Auth.LoginWithEmail(email, password, result =>
{
if (result.Ok) UnityEngine.Debug.Log("Signed in.");
else UnityEngine.Debug.LogWarning(result.Error.Message);
});
For the Admin tab, put the developer secret in PLAYFAB_DEV_SECRET or the gitignored Assets/Editor/PlayFabAdmin/.secret. Never put it in Resources, a scene, or runtime settings. Leave DRY-RUN enabled until you have reviewed the target title and payload. Use a disposable title for first deployment.
Read reliability and IAP limits, server integration, and troubleshooting before shipping a game. Offline documentation is at Documentation/index.html and the linked HTML guides. Support: mindinvadersgames@gmail.com.