Skip to main content
PlayFab Samples is a community-driven library of practical, working examples that show you how to integrate PlayFab features into your games. Whether you’re building your first game or adding new features to an existing title, you’ll find ready-to-run code for the patterns and mechanics you need most.

Quickstart

Set up your first PlayFab title and run a sample in minutes

Unity Samples

Complete Unity projects covering authentication, leaderboards, events, and more

Azure Functions

Server-side game logic with PlayFab and Azure Functions integration

Recipes

Drop-in patterns for player retention, monetization, and user acquisition

What’s included

The repository is organized into three main areas:

Samples

Complete, runnable projects targeting specific platforms and engines. Each sample demonstrates best-practice usage of one or more PlayFab features.
SamplePlatformFeatures covered
PlayFab Sign-InUnityAuthentication (email, guest)
Space RumbleUnityAccounts, leaderboards, CloudScript, events
LeaderboardsUnityStatistics, leaderboard read/write
EventsUnityPlayer, title, and character events
CommerceUnity / AndroidVirtual currency, catalog, in-app purchases
Tic Tac ToeUnity + AzureAzure Functions, game state, AI logic
Messaging / SignalRC#Real-time notifications, matchmaking

Recipes

Focused examples that implement a single common game mechanic using PlayFab building blocks. Each recipe ships with both a Unity 3D package and a JavaScript version.

Daily Prize Wheel

Randomized daily reward using virtual currency and drop tables

Progressive Rewards

Escalating login-streak bonuses with CloudScript

Referral Codes

Reward both the referrer and referee with a redeemable code flow

Regenerating Currency

Time-limited play mechanic that slowly refills over time

Cross Promotion

Reward players who participate in multiple of your titles

Prerequisites

Before running any sample you need: Individual samples may also require Unity, Visual Studio, or an Azure subscription. See each sample’s page for its specific requirements.
All samples use the MIT license. See LICENSE for details.

Build docs developers (and LLMs) love