Use Cloud Code
Understand how you can use Cloud Code modules or scripts with the Triggers service.
Read time 1 minuteLast updated 3 hours ago
You can set up a trigger to run a Cloud Code script or module to execute your custom server-side logic. Cloud Code lets you write and run server-side code without managing infrastructure. For more information, refer to Cloud Code. Triggers enable you to run Cloud Code automatically in response to server events, without requiring client requests. For example, you can use this pattern for the following tasks:
- Automate rewards: Give top players seasonal bonuses without a request from the client.
- Send notifications: Wish players happy new year, congratulate level ups, or alert them of competitive updates.
- Initialize data: Seed new players with default game configuration on sign-up.
- Maintain server state: Sync player achievements across services, enforce game rules, or moderate content
- Time-based events: Execute actions at specific moments using the Scheduler service