Skip to content

Referência completa de configuração

ts
MindtrainingPlatform.init('mindtraining', {

  // ── Viewer ────────────────────────────────────────────────────────────────
  viewer: {
    userId: string | null,     // ID do seu utilizador
    loggedIn: boolean,         // predefinido: false
    subscribed: boolean,       // predefinido: false
  },

  // ── UI ────────────────────────────────────────────────────────────────────
  ui: {
    mode: 'web' | 'app',       // predefinido: 'web'
    actions: {
      openLogin:       () => void,
      openRegister:    () => void,
      openSubscribe:   () => void,
      openUrl:         (url: string) => void,
      share:           (payload: { url?: string, title?: string }) => void,
    },
  },

  // ── Access ────────────────────────────────────────────────────────────────
  access: {
    games: {
      [gameType]: {
        default: {
          playToday: boolean,        // predefinido: true
          playArchive: boolean,      // predefinido: true
          saveState: boolean,        // predefinido: true
          blockedReason: 'login_required'
                        | 'subscription_required'
                        | 'host_rule'
                        | 'variant_locked',
          blockedReasons: {
            default?: BlockedReason,
            today?:   BlockedReason,
            archive?: BlockedReason,
          },
          meterLimit: {
            maxStarts:    number,    // máximo de inícios de jogo permitidos
            intervalDays: number,    // janela móvel em dias
          },
          levelLimit: {
            maxLevel: number,        // nível máximo de dificuldade permitido
          },
        },
        variants: {
          [variantId]: AccessPolicy, // mesma estrutura de default
        },
      },
    },
  },
})

Client integration documentation maintained in-repo.