Skip to content

Full Configuration Reference

ts
MindtrainingPlatform.init('mindtraining', {

  // ── Viewer ────────────────────────────────────────────────────────────────
  viewer: {
    userId: string | null,     // your user's ID
    loggedIn: boolean,         // default: false
    subscribed: boolean,       // default: false
  },

  // ── UI ────────────────────────────────────────────────────────────────────
  ui: {
    mode: 'web' | 'app',       // default: '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,        // default: true
          playArchive: boolean,      // default: true
          viewStatistics: boolean,   // default: true
          saveState: boolean,        // default: true
          blockedReason: 'login_required'
                        | 'subscription_required'
                        | 'host_rule'
                        | 'variant_locked',
          blockedReasons: {
            default?: BlockedReason,
            today?:   BlockedReason,
            archive?: BlockedReason,
            statistics?: BlockedReason,
          },
          meterLimit: {
            maxStarts:    number,    // max game starts allowed
            intervalDays: number,    // rolling window in days
          },
          levelLimit: {
            maxLevel: number,        // max difficulty level allowed
          },
        },
        variants: {
          [variantId]: AccessPolicy, // same shape as default
        },
      },
    },
  },
})

Public SDK API

ts
type MindtrainingPlatformApi = {
  init: (
    containerOrConfig?: string | Element | PlatformInitConfig,
    config?: PlatformInitConfig
  ) => void
  updateConfig: (config?: Partial<PlatformInitConfig>) => PlatformInitConfig
  navigateHome: () => boolean
}

navigateHome() returns true when the mounted SDK router handled the request, and false when the SDK is not mounted yet.

Client integration documentation maintained in-repo.