Custom fields/attributes

Smartico allows you to extend any gamification element with custom fields, enabling you to add additional data that enhances your custom UI.

What Are Custom Fields?

Custom fields are user-defined attributes that can be attached to various gamification elements, such as Tournaments, Missions, Badges, Levels, Mini-Games, and Store Items. These fields are not used by Smartico’s internal logic or the default Gamification widget, but they are available for use in custom UIs built with Smartico APIs.

Example Use Case

Suppose you want to classify tournaments as VIP or Regular. You can add a custom field to a Tournament to store this information and then use it in your own UI to visually distinguish VIP tournaments.

Another example can be seen on our Expo page - https://expo.smartico.ai/widgets/api_custom_lvl_map

Custom levels UI with additional fields/attributues

By default, player levels only include:

  • Name

  • Description

  • Image

  • Progress information

Default attributes of levels

However, many casino and sportsbook operators associate player levels with perks such as cashback percentages, rakeback, or VIP status. To showcase this, we added custom fields like:

  • Cashback (%)

  • Monthly Rakeback (%)

  • VIP Club Membership

Custom attributes

These fields are defined by the operator in Smartico BackOffice, and their values are fetched via the Smartico API to display them in a custom UI.

Technical Details

Defining Custom Fields

Custom fields can be set up for different gamification elements, such as:

  • Tournaments

  • Levels

  • Badges

  • Mini-Games

  • Store Items

  • Prizes

Custom fields are defined using JSON format. Below is an example:

[
  {
    "name": "cashback",
    "field": "int",
    "label": "Cashback, %",
    "required": false
  },
  {
    "name": "rakeback",
    "field": "int",
    "label": "Monthly Rakeback, %",
    "required": false
  },
  {
    "name": "has_vip_club",
    "field": "bool",
    "label": "VIP Club",
    "required": true
  },
  {
    "name": "reward",
    "field": "text",
    "label": "Reward",
    "required": false,
    "translatable": true
  },
  {
    "name": "image_inactive",
    "field": "image",
    "label": "Image (Inactive)",
    "required": false
  },
  {
    "name": "image_active",
    "field": "image",
    "label": "Image (Active)",
    "required": false
  }
]

Accessing Custom Field Data via API

Once defined, you can access custom field values from the API like this:

javascriptCopyEditsmartico.api.getLevels().then((result) => {
     console.log(result[0].custom_data.cashback);
});

This will fetch the cashback percentage assigned to the level and allow you to display it in your custom UI.


By leveraging custom fields, you can enhance user engagement and personalize the gamification experience to better suit your needs. 🚀

Last updated

Was this helpful?