PlayFab recipes and samples

Here are some links to recipes and samples that you can download and run, to gain a better understanding of how to use PlayFab features in code.


This collection of examples shows familiar patterns and mechanics implemented using PlayFab.

Player retention

  • Daily Prize Wheel - Give players a randomized gift every day, based on the values on a "Prize Wheel".
  • Progressive Reward System - Players that sign in consecutively over several days are granted an item, depending on how long their login streak is.

User acquisition

  • Referral Code Bonus - Generate and send codes to friends that they can redeem and unlock a bonus for both the referrer and themselves.
  • Cross-Promotional Rewards - Reward players participating in more than one of your games.



These samples provide complete code snippets that demonstrate various PlayFab features.

Sample Name Platforms Engine Description Demonstrated Capabilities
PlayFabCommerce Android Android Studio This sample uses Android's in-app billing API and PlayFab client API, to demonstrate an in-app store that exchanges real money for virtual items in PlayFab Economy.
  • Login
  • In app purchases
PlayFabSignIn iOS, Android, PC Unity This sample demonstrates a simple PlayFab sign in flow. You may log in with an email/password, create an account, or log in as a guest. Sign in information may be remembered across executions of the sample.
  • Login
PlayFabEventsUnity Android, iOS, PC Unity This sample demonstrates sending events from within a Unity title. The sample covers player events, title events and character events.
  • Events
PlayFabLeaderboardsUnity Android, iOS, PC Unity This sample demonstrates reading and writing from/to leaderboards from within a Unity title. The sample covers lowest score/best time, high score and cumulative score leaderboards.
  • Leaderboards
SpaceRumble Android, iOS, PC Unity This sample demonstrates a simple single-player mobile game.
  • User accounts
  • User title data
  • Title data
  • Events that trigger CloudScript
  • Leaderboards
ThunderRumble PC, Xbox C++ DirectX Native This sample demonstrates scalable cloud dedicated server functionality, using the PlayFab Multiplayer Servers technology to build a complete end-to-end game experience.
  • Login
  • Matchmaking
  • Multiplayer Servers