PlayFab Playstream Reference
PlayStream is an event processing system that unifies the entire data flow from your game into a single event stream. Visualize and take actions on that stream in real-time. Then forward the events onward to wherever they need to go, including webhooks, Add-ons, or your own S3 bucket or RedShift cluster.
PlayStream includes the following components:
PlayFab APIs and Marketplace Add-ons write events into the event pipeline automatically, based on player behavior and other activity in your game. You can write custom events, represented as JSON data, from your game client or server using the new WriteEvent APIs. The event pipeline reliably captures and stores events, and it automatically scales to handle growing event volumes. Tracking information about each event is updated in real-time at every stage of the pipeline.
Rules for triggering actions based on matching events are defined using the visual rule editor in the Game Manager. For example, you could define a rule that grants players an inventory item, sends them a push notification, or even executes one of your Cloud Script functions whenever your game sends an event indicating they completed a tutorial. These rules are matched to events in the pipeline and trigger their actions in real-time, making them suitable for implementing game logic. This gives you the flexibility to tweak your game without requiring code changes or client updates.
Real-time Player Segmentation
Define segments of players based on profile properties such as statistics, virtual currencies, source, or login behavior using the visual segment builder in the Game Manager. PlayStream triggers actions as players enter or exit segments, in real-time. For example, you could define a segment and action to grant a virtual currency to players who have linked their Facebook accounts as soon as their “XP” statistic is greater than 10.
Inspect events in real-time as they flow through the pipeline, and see triggered actions or player segment changes as they happen. Watch a single player’s event stream as you debug during play testing, or view the sampled stream of events for your whole player population to get a feel for the pulse of your live game.
Forward some or all of the events to external web services via webhooks, and get a complete history of event deliveries. You can use webhooks to integrate with a custom analytics provider or to tie-in to your existing backend services.
Filter, search, and view historical events, including delivery history. View a player’s events to assist with customer service, or inspect the delivery status of an event to debug your partner integrations.
Store a full copy of all events in your own AWS S3 bucket, formatted for direct import into RedShift or for processing by Elastic Map Reduce jobs.
For an introduction to using PlayStream, see this blog post. A detailed guide is in the works and will be posted here when complete.
- Events View the schema of the built-in events that are generated by PlayFab APIs and written to the PlayStream event pipeline. Your PlayStream rules may access any of these fields to decide when to trigger an action.
- Profile View the schema of the player profile that is used for real-time segmentation. The properties of the player profile can also be used by rules engine actions. For example, the profile is passed as a parameter to triggered CloudScript functions and to push notification message templates.
- API View our API documentation for more information on how to structure PlayStream requests.