PlayFab feature setup¶
On this page
- PlayFab feature setup
- Start here
- Authentication
- Player data, profiles and content
- Leaderboards and statistics
- Economy v1: virtual purchases
- Economy v2: virtual purchases
- Real-money IAP: legacy receipt helpers
- CloudScript
- Friends and groups
- Analytics and LiveOps
- Notifications and email
- Lobby and matchmaking
- Editor administration and UGC
- Before shipping your game
Checked against the package's API calls and Microsoft documentation on 13 September 2026. Complete the sections for the features you use on each development, staging and production title. Menu names can change; the linked API documentation identifies the underlying requirement.
Start here¶
Install the prerequisites in Getting started, create the Hub settings, select the correct environment Title ID, enable the feature in the roster and its configuration block, initialize the Hub, and log in before calling authenticated APIs. Entity-based features also need the title-player entity token obtained at login. A PlayFabId and a title-player entity ID are different identifiers.
Hub feature switches configure the Unity client; they do not enable PlayFab products, publish content, change API policy, or deploy handlers. Setup/Health Check results cover specific checks only. A green row is not proof that a purchase, push notification or custom handler works end to end.
If your title has a customized API access policy, allow the specific Client/entity endpoints used by your enabled features. Diagnose the returned API error before changing policy. Do not replace a restricted policy with an unrestricted one simply to clear an error. Developer keys belong in trusted editor/server tooling, never the shipped client. API access policy
Authentication¶
Start with the Login demo's email registration and login. Existing accounts must belong to the selected title. Configure account recovery/email delivery for your title and verify recovery with a test account before advertising it. Email setup
Custom ID and Android/iOS device-ID login are anonymous identity methods, not Google/Apple account sign-in. New titles disable anonymous client account creation by default. Provision accounts through a trusted server, or use email/platform registration. Only for a temporary development test, review the anonymous player-creation option under Game Manager > Settings > API Features. Setting auth.createAccountOnFirstRun in Unity does not override title policy. Anonymous login
For Google Play Games, install/configure Google's Unity plugin, package/signing credentials and OAuth configuration, configure the PlayFab Google add-on, and supply a server auth code to the Hub login method. For Apple, configure the Apple add-on and matching app/service identifiers, add the native Sign in with Apple capability/plugin, and supply an Apple identity token. The Hub does not obtain either token for you. Test on the target platform. Google sign-in, Apple sign-in
Player data, profiles and content¶
Classic GetUserData/UpdateUserData operate on player-writable key/value data. Use them for data the player may edit; server-owned balances and entitlements need trusted writes. Read-only/internal User Data are separate PlayFab stores, not what these wrappers write. Player Data
For entity objects, retain the default title_player_account type for player documents and use the entity ID/token returned by authentication. Choose object names and stay within your title's object limits. Use the matching read's ProfileVersion for optimistic concurrency. Entity objects
For profile reads, configure Game Manager > Settings > Client Profile Options to permit the fields you request in ProfileConstraints. Requesting a field does not grant permission to view it. GetPlayerProfile
Create public remote-config keys under Content > Title Data. JSON helper values must be valid JSON strings. Internal Title Data is not readable by these client methods; do not put secrets in public Title Data. A missing/malformed JSON value can return your fallback with Ok, so verify the returned value as well as the status. Title Data setup
Publish Title News before expecting news entries. For GetContentDownloadUrl, upload the file to PlayFab's Content/CDN service and use its exact key; an entity file or Economy v2 content ID is not the same resource. CDN availability and charges depend on your title/service plan. Content APIs
Verify with a test-player save/read round trip, one permitted profile read, and one known Title Data/content key.
Leaderboards and statistics¶
This package uses legacy Player Statistics and their leaderboards, not the newer Progression leaderboard APIs. Create/configure the statistic in your title's legacy leaderboards/statistics area, choose its aggregation and reset policy, and use its exact name in your calls or sample. Submit a test score before expecting a populated board.
To post scores directly from Unity, both settings are required: set LeaderboardConfig.writeAuthority to ClientDirect; then open Game Manager > your title > Settings > API Features > Enable API features, enable Allow client to post player statistics (AllowClientToPostPlayerStatistics), and save. The title-specific URL is https://developer.playfab.com/en-us/r/t/TITLE_ID/settings/api-features — replace TITLE_ID with your actual title ID.
That title setting allows players to submit arbitrary statistic values. Use it only when this matches your game's trust model, such as prototyping. It is not required for leaderboard reads or server-written scores. Microsoft's player-statistics guide
The default CloudScript write authority makes SubmitScore refuse the client write; it does not automatically call a score handler. Enable CloudScript, deploy your own handler that validates the result and writes the statistic using the Server API, and call it through PlayFabHub.CloudScript.ExecuteChecked. Keep client statistic posting disabled for that workflow. A handler accepting an arbitrary client score without validation is still not authoritative.
For seasons, configure the statistic's scheduled reset, or deploy an authorized reset handler and set versionResetFunctionKey. The package does not supply a score/reset handler. See seasons and handler contracts. Verify global/around-player reads after the chosen write path succeeds; a player without a score may have no placement.
Economy v1: virtual purchases¶
Create a legacy catalog and items under Economy > Catalogs, define two-character virtual currencies and prices, and configure catalogVersion and optional storeId to match. Provision a test player's balance through trusted administration. Pass the actual catalog/store price when purchasing; consume owned item-instance IDs, not catalog IDs. An empty catalogVersion uses the title's primary catalog. Legacy economy setup, stores
Client currency-grant permissions are not needed for these purchase/consume helpers. Verify that buying reduces the appropriate balance and adds the expected item, then test consumption of a consumable item.
Economy v2: virtual purchases¶
Enable the catalog in your title's Economy (V2) settings (IsCatalogEnabled). Configure a content type, create and publish the currency and item, and publish the item's currency price option. Draft/unreleased content may not appear for ordinary players. Provision test currency using trusted title administration. Economy v2 quickstart
Use v2 item IDs, price amounts and the same inventory collectionId for balances and purchases (default unless changed). V1 currency balances do not fund a v2 purchase. The shipped Shop demos use this v2 virtual-currency path. Do not grant players catalog-administrator privileges to make a shop work. Verify catalog search, inventory, purchase and balance changes with an ordinary player account.
The version setting identifies the intended economy; explicitly suffixed methods such as PurchaseItemV1 and PurchaseItemV2 call their named API generation. It does not redirect receipt validation to v2.
Real-money IAP: legacy receipt helpers¶
Install and integrate Unity IAP or your chosen native store SDK separately for checkout, pending orders and restores. This release unwraps supported Google Play and Apple/Mac unified receipts and calls PlayFab's legacy Client validation endpoints. PlayFab validates remotely; the device does not decide authenticity. No custom CloudScript is required for these built-in helpers. V2 real-money redemption and a durable fulfillment ledger are not included.
Configure the corresponding Google/Apple add-on for the same app/title, store product IDs and receipt-validation credentials. Sign-in setup alone does not configure purchases. Map the store SKU to the legacy catalog item and configure its real-money pricing/fulfillment. The current Hub receipt wrappers do not send CatalogVersion, so use the title's primary legacy catalog for this receipt path even when other v1 calls select a named catalog. Pass the receipt unchanged with the store's currency and price in the API's centesimal units. Google validation and mapping, Apple validation
Test with real sandbox receipts. Confirm/consume the store order only after reconciling successful fulfillment; keep pending transactions recoverable across restarts. Reconcile already-used receipts rather than granting again. Unity Editor fake-store receipts are not proof of store validation. See IAP reliability and limits.
CloudScript¶
For the default Legacy JavaScript backend, deploy the handlers.NAME functions to a live CloudScript revision under Automation > CloudScript. Register matching keys/names in cloudScript.functions or call the deployed name directly. The wrapper uses the live revision; a saved but unpublished draft is insufficient. Start with the included read-only server-time example. CloudScript quickstart
For optional Azure Functions, create/deploy your Function App, register the function with this PlayFab title, and select AzureFunctions in the Hub. Keep the function authorization key in trusted registration, not Unity settings. Legacy JavaScript upload tools do not deploy Azure functions. Azure Functions setup
Match your handler's result to okField/errorField for ExecuteChecked. Authorize the caller and validate inputs inside every handler. The source-assignment smoke check does not execute handlers or test receipt validation. See server integration.
Friends and groups¶
For friends, create two accounts on the same title and pass the friend's PlayFabId. Friendship is one-way by default; reciprocal approval is a game policy. External Steam/Facebook friends additionally require linked provider accounts and corresponding platform configuration; leave those switches off if unused. Friends quickstart
Groups use title-player entity IDs and entity tokens. Create a group, retain its group ID, and test the invitation/application and acceptance paths with a second player. Membership and roles govern administration. Entity-object permissions also govern group document access; verify read/write behavior separately as an admin, ordinary member and non-member. Do not broadly relax policies to clear Forbidden. Use trusted handlers for protected shared state. Groups quickstart, group data examples
Analytics and LiveOps¶
Analytics is disabled by default. Enable it intentionally, apply your consent policy, log in and call Track with an event name/body. The implementation sends individual Client WritePlayerEvent calls into PlayStream; it does not use v2 telemetry namespaces or batching. eventNamespace is not sent by this path. Verify the event on the correct player/title; delivery is best-effort. WritePlayerEvent
For segments, define your intended segment rules in Game Manager and use a player that meets them. GetPlayerSegments For experiment variants, configure and start an experiment with the intended audience and variables; an unassigned player may receive no variants. Experiment setup, treatment assignments
For scheduled events, enable both LiveOps and Player Data, create the public Title Data key LiveEvents (or your configured key), and supply the documented JSON with UTC windows. Missing or invalid documents resolve to an empty list; check the content, not just Ok. These windows drive presentation, not server reward authorization. Event schema
Notifications and email¶
Configure your title's push channel under Settings > Push Notifications and supply matching FCM/APNS credentials using the current provider integration. Add the platform messaging SDK/capabilities and OS permission flow, obtain a real device token, log in, and call RegisterAndroid or RegisterIOS. Registration alone does not deliver a notification. Send a test from trusted tooling and verify it on the device. Push setup
Unity Mobile Notifications alone is not an Android FCM token provider; an Android push integration needs an FCM-capable plugin. Older PlayFab examples use legacy GCM/FCM terminology, so check current channel support and credential requirements. The package accepts tokens; it does not include the native SDK. For email, SetContactEmail stores the address; configure your title's email provider/templates and sending workflow separately.
Lobby and matchmaking¶
Enable Multiplayer in the Hub and authenticate a title-player entity. For lobby operations, configure capacity/access/search data for your game, share the returned connection string with the intended player and test join/leave. A lobby does not provide gameplay transport or a game server. Lobby and matchmaking
Create a queue under Game Manager > Multiplayer > Matchmaking and copy its exact name to multiplayer.queueName. Begin with a two-player queue and two separate authenticated clients. The convenience ticket method sends the creator entity but no custom attribute payload: use rules compatible with that request, entity-sourced attributes, or your own SDK integration for custom ticket attributes. Matchmaking configuration, ticket attributes
Do not enable server allocation on a queue unless you have separately configured compatible PlayFab Multiplayer Servers. Verify match completion and cancellation; queue setup is unnecessary when using only lobby methods. Server allocation
Editor administration and UGC¶
Configure the Admin target title and developer key via the environment variable or gitignored secret file described in configuration. Set your catalog/Title Data/CloudScript source adapters and preview changes with DRY-RUN first. The Admin catalog pusher and catalog diff target legacy v1; the v2 configuration probe is not a v2 catalog-authoring tool.
For UGC inspection, enable/configure the v2 catalog and the content type you inspect. For optional moderation writes, deploy your own authorized handlers and configure their names and argument contract. See UGC integration. Health checks and source previews do not validate your custom authorization policy.
Before shipping your game¶
Repeat each enabled feature's verification with an ordinary player on the intended title. Record platform/device results separately from Editor tests. Check troubleshooting and the returned HubError when a step fails. This guide documents configuration; it does not claim that every platform integration or customer handler was live-tested by this package.