Skip to content

Referencia completa de configuración

ts
MindtrainingPlatform.init('mindtraining', {

  // ── Viewer ────────────────────────────────────────────────────────────────
  viewer: {
    userId: string | null,     // ID de tu usuario
    loggedIn: boolean,         // por defecto: false
    subscribed: boolean,       // por defecto: false
  },

  // ── UI ────────────────────────────────────────────────────────────────────
  ui: {
    mode: 'web' | 'app',       // por defecto: '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,        // por defecto: true
          playArchive: boolean,      // por defecto: true
          saveState: boolean,        // por defecto: true
          blockedReason: 'login_required'
                        | 'subscription_required'
                        | 'host_rule'
                        | 'variant_locked',
          blockedReasons: {
            default?: BlockedReason,
            today?:   BlockedReason,
            archive?: BlockedReason,
          },
          meterLimit: {
            maxStarts:    number,    // máximo de inicios de juego permitidos
            intervalDays: number,    // ventana móvil en días
          },
          levelLimit: {
            maxLevel: number,        // nivel máximo de dificultad permitido
          },
        },
        variants: {
          [variantId]: AccessPolicy, // misma forma que default
        },
      },
    },
  },
})

Client integration documentation maintained in-repo.