How It Works
Rule Structure
Every rule consists of:- Trigger: The event that activates the rule
- Conditions: Optional filters to check before executing
- Actions: What happens when conditions are met
Condition Types
property_equals
property_equals
Check if an event property equals a specific value.
property_greater_than
property_greater_than
Check if a numeric property exceeds a threshold.
property_less_than
property_less_than
Check if a numeric property is below a threshold.
player_level_equals
player_level_equals
Check the player’s current level.
player_level_greater_than
player_level_greater_than
Check if player has reached a minimum level.
time_window
time_window
Only trigger during specific times.
first_time
first_time
Only trigger the first time this event occurs for the player.
cooldown
cooldown
Limit how often a rule can trigger for a player.
Action Types
GRANT_XP
GRANT_XP
Award experience points to the player.
GRANT_CURRENCY
GRANT_CURRENCY
Award virtual currency.
GRANT_BADGE
GRANT_BADGE
Award a badge to the player.
PROGRESS_QUEST
PROGRESS_QUEST
Increment progress on a quest.
UNLOCK_QUEST
UNLOCK_QUEST
Make a quest available to the player.
UPDATE_LEADERBOARD
UPDATE_LEADERBOARD
Update a player’s leaderboard score.
SEND_NOTIFICATION
SEND_NOTIFICATION
Send a push notification or in-app message.
EMIT_EVENT
EMIT_EVENT
Emit a custom event (can trigger other rules).
Dynamic Values
Use dynamic values in actions with template syntax:| Variable | Description |
|---|---|
${player.id} | Player’s ID |
${player.xp} | Player’s current XP |
${player.level} | Player’s current level |
${event.name} | Triggering event name |
${event.properties.X} | Event property value |
Rule Priority
When multiple rules can trigger from the same event, they execute in priority order:Testing Rules
Use the Rules Sandbox in the Admin Console to test rules before deploying:- Select a rule to test
- Provide a mock event payload
- See which actions would execute
- Verify conditions are evaluated correctly
Best Practices
Keep rules simple
One rule should do one thing well. Chain multiple rules for complex logic.
Use meaningful names
Name rules clearly so team members understand their purpose.
Add cooldowns
Prevent abuse by adding cooldowns to high-reward rules.
Test thoroughly
Use the sandbox and staging environments before production.