Pular para o conteúdo principal

Gamification

Integrate Smartico gamification features into your brand.

Prerequisites

  • An active Smartico account with keys provided by the Cactus team
  • Keys: labelKey, brandKey, saltKey (and optionally visitor keys)

Configuration

Configure by file (base + brand override):

  • app/config/gamification/gamification.ts
  • app/config/gamification/gamification.server.ts
  • overrides/<brand-key>/app/config/gamification/gamification.ts
  • overrides/<brand-key>/app/config/gamification/gamification.server.ts

<brand-key> is derived from ORIGIN_DOMAIN (state77.com -> state77-com).

Edit gamification.config.ts:

smartico: {
labelKey: 'your_label_key',
brandKey: 'your_brand_key',
// ...
}

Server-side salt key

The saltKey used for user hash generation is a server-side secret and must be configured via the SMARTICO_SALT_KEY environment variable (.dev.vars for local dev, Cloudflare secret for production).

The gamification.server.config.ts file still exists as a fallback, but the environment variable takes priority:

  1. SMARTICO_SALT_KEY env var (Cloudflare secret / .dev.vars)
  2. gamification.server.config.ts config file (fallback)
cuidado

Never commit real salt keys in override files. Use the environment variable instead. The Cactus team will configure the Cloudflare secret for your brand.

informação

Gamification/Smartico settings are driven by config overrides per brand.

Enabling / disabling modules

Each gamification feature can be toggled in app/config/gamification/gamification.ts:

modules: {
missions: { enabled: true, native: true },
tournaments: { enabled: true, native: true },
store: { enabled: true, native: true },
miniGames: { enabled: true, native: true },
levels: { enabled: true, native: true },
notifications: { enabled: true, native: true },
badges: { enabled: true, native: true },
bonuses: { enabled: true, native: true },
jackpots: { enabled: true, native: true },
raffles: { enabled: true, native: true },
}
  • enabled: true — module is active
  • enabled: false — module is completely hidden (no buttons, no pages)
  • native: true — uses custom React UI (recommended)
  • native: false — uses Smartico's built-in overlay widget

Available routes

When modules are enabled with native: true, these pages are available. The paths shown below are the defaults — they are configurable via the Route Registry.

KeyDefault pathDescription
gamification/vipGamification hub
gamification.missions/vip/missionsMissions listing with filters
gamification.tournaments/vip/tournamentsTournaments listing with filters
gamification.tournament/vip/tournaments/:idTournament detail (leaderboard, prizes)
gamification.store/vip/storeStore with filters
gamification.miniGames/vip/mini-gamesMini-games listing
gamification.levels/vip/levelsLevel progress timeline
gamification.badges/vip/badgesBadges listing
gamification.bonuses/vip/bonusesBonuses listing
user.notifications/user/notificationsNotifications inbox
dica

Brands can customise all gamification paths. For example, state77 uses /gamificacion/misiones instead of /vip/missions. Use routeHref("gamification.missions") for links — never hardcoded paths.

Visitor mode

Logged-out users can browse mission and tournament listings. When they try to open a detail page, they are prompted to log in.

Customization tips

  • Naming: Change naming.programName and naming.coinsName in the config to match your brand
  • Sidebar buttons: The VIP highlight buttons in the sidebar can be styled via your theme tokens
  • Disable specific modules: Set enabled: false for modules you don't need
  • Use Smartico UI for everything: Set native: false on all modules to use Smartico's built-in overlays instead of custom React pages