Widget Configurations
Configurations API for Adaptive UI Elements
When building UI elements for your app or webpage, it is essential to make these elements adaptive to the current configurations set within Gameball. For example, consider a scenario where your business decision disables the Gameball cashback program during the financial year closing. In this case, your UI should adapt and hide any elements related to cashback during that period.
This would typically require code changes and redeployment each time you update the configuration within the Gameball dashboard. However, Gameball provides the Widget Configurations API, which eliminates the need to manually update your static content every time there is a change. Instead, the Configurations API helps ensure that your UI automatically adapts to any changes made within Gameball’s platform, without requiring a redeployment.
Key Use Cases for the Configurations API:
Adaptive UI Elements: Dynamically show or hide UI components based on configuration flags.
Program Configurations: Retrieve the status of different Gameball programs (like Cashback, Leaderboards, etc.) and adapt the UI accordingly.
Business Decisions: Reflect operational decisions, like disabling certain programs (e.g., Cashback) without redeployment of the entire UI.
Example: Widget Configurations API Response
The Configurations API returns a set of configuration flags, which control the visibility and status of various Gameball programs. Below is a sample response from the Widget Configurations API:
Adaptive UI Based on Flags:
In this response, there are several flags that determine whether different Gameball features should be enabled or disabled in your app/webpage:
gameballEnabled: If
false
, all Gameball-related UI elements should be disabled or hidden.cashbackEnabled: If
false
, elements related to the Cashback program (like cashback balance, cashback offers, etc.) should be hidden.notificationsEnabled: If
false
, notifications should not be displayed.
Example Scenario:
Let’s consider a scenario where the cashbackEnabled
flag is set to false
. This means any UI elements related to the cashback program, such as cashback balances or offers, should be disabled or hidden. Similarly, when the gameballEnabled
flag is false
, all Gameball-related features (including Cashback, Profile, Leaderboards, etc.) should be hidden regardless of the individual program’s status.
Steps to Integrate the Configurations API:
Make an API Request: Call the Configurations API to retrieve the current settings and configurations.
Parse the Response: Based on the response flags, conditionally render or hide UI components.
Reflect Business Decisions Dynamically: Use the response to dynamically adapt the UI to reflect any changes, without requiring code redeployment.
Important Notes:
Dynamic Business Decisions: The configurations API ensures your UI remains consistent with any business decisions made through the Gameball dashboard without needing to redeploy your application.
No Code Changes Required: Simply use the flags returned by the API to control visibility in your UI, based on your current configuration.
Last updated