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: falseand omituserIdfor anonymous / unauthenticated sessions.