Prerequisites
Before you begin, complete the setup steps in Quickstart Setup to configure your development environment and project.What you’ll accomplish
By the end of this quickstart, you’ll have:- Set up the PlayFab Unified SDK in your Windows project
- Initialized the SDK with your Title ID
- Authenticated a player using XBOX or Steam
- Obtained an entity handle for making API calls
- Properly cleaned up resources
In this quickstart
Step 1: Initialize the SDK
Include required headers
Start by including the necessary PlayFab and XBOX Game Runtime headers in your project:Initialize XBOX Gaming Runtime Services
The PlayFab Unified SDK requires XBOX Game Runtime. Initialize it first:Initialize PlayFab Core
Initialize the PlayFab SDK and create a service configuration handle. ReplaceABCDEF with your actual PlayFab Title ID:
Step 2: Authenticate a Player
PlayFab requires player authentication before making API calls. The SDK provides several authentication methods depending on your platform and requirements.Choose your authentication method
Option A: Login with XBOX (Recommended for Windows/XBOX)
UsePFAuthenticationLoginWithXUserAsync to log in with an XBOX user account. This is the recommended method for Windows and XBOX applications.
Option B: Login with Steam
For Steam-integrated games, usePFAuthenticationLoginWithSteamAsync with a Steam authentication ticket.
The
PFEntityHandle returned from login is required for all subsequent PlayFab API calls. Keep this handle available throughout your application’s lifetime.Step 3: Clean up resources
When your application shuts down, properly clean up all resources to prevent memory leaks and ensure graceful termination:Always clean up resources in the reverse order of initialization to ensure proper shutdown.
Next steps
Now that you’ve initialized the SDK and authenticated a player, you’re ready to start calling PlayFab services:Make your first API call
- Calling PlayFab Services - Learn how to call PlayFab APIs to manage player data and use game services
Core concepts
- Asynchronous operations - Understanding PlayFab’s async programming model
- Memory management - Best practices for managing SDK memory
- Tracing and diagnostics - Debugging and monitoring your integration
Advanced authentication
- Multi-platform authentication - Support multiple authentication providers
- Custom ID authentication - Use your own authentication system
- Account linking - Link multiple authentication methods to one account
