Skip to content

UI Actions

Use ui.actions to connect the platform's call-to-action buttons (login, subscribe, share…) to your site's own modals or flows.


js
MindtrainingPlatform.init('mindtraining', {
  ui: {
    mode: 'web', // 'web' (default) | 'app'
    actions: {
      openLogin: function () {
        // open your login modal
      },
      openRegister: function () {
        // open your registration modal
      },
      openSubscribe: function () {
        // open your subscription page or modal
      },
      openUrl: function (url) {
        window.open(url, '_blank')
      },
      share: function (payload) {
        // payload: { url?: string, title?: string }
        navigator.share({ url: payload.url, title: payload.title })
      },
    },
  },
})

Set ui.mode to 'app' when embedding inside a native mobile app WebView to adjust certain UI behaviors.

Client integration documentation maintained in-repo.