Skip to content

Viewer (User) Configuration

Pass the current user's session data so the platform can personalize the experience and enforce access rules correctly.

js
MindtrainingPlatform.init('mindtraining', {
  viewer: {
    userId: 'user-123',       // your internal user ID (string or null)
    loggedIn: true,           // whether the user is authenticated
    subscribed: true,         // whether the user has an active subscription
  },
})

Pass loggedIn: false and omit userId for anonymous / unauthenticated sessions.

Client integration documentation maintained in-repo.