Overview
Players are the core entities in EngageFabric. Each player represents a user in your application who can earn XP, level up, complete quests, and appear on leaderboards.Creating Players
Players are identified by anexternalUserId - typically the user ID from your own system.
Retrieving Players
Get by External User ID
Get Player State
Retrieve comprehensive player state including XP, level, currencies, and active quests:Updating Players
Update Profile
Add XP
XP is typically awarded through the Rules Engine via events, but you can also add it directly:Modify Currencies
Player Metadata
Metadata allows you to store custom data with each player. This is useful for:- Storing user preferences
- Tracking subscription tiers
- Custom segmentation
- Integration with your app’s data
Listing Players
Deleting Players
Admin Operations
These endpoints are available to authenticated admin users via the Admin Console or JWT authentication.Player Activity Log
View a complete activity history for a player, including client events and system events:Admin XP Adjustment
Admins can manually adjust player XP with an audit trail:Negative amounts are allowed for XP deductions. All adjustments are logged to the audit trail.
Admin Currency Adjustment
Admins can adjust any currency balance:All admin adjustments are recorded in the Audit Log with the admin’s identity, timestamp, and reason. This ensures accountability and enables compliance reporting.
Best Practices
Use Consistent IDs
Always use the same
externalUserId format across your application to avoid duplicate players.Batch Operations
When updating multiple players, use batch endpoints to reduce API calls and improve performance.
Cache Player State
Cache player state on the client side and use webhooks to invalidate when changes occur.
Handle Conflicts
Use upsert operations when player creation might race with other operations.
Related
Event Tracking
Learn how to track player actions and trigger rewards
Game Economy
Understand XP, levels, and currencies
