Skip to content

The only tool you need to know what is happening and how to fix it.

1.3 KB
Raw Blame
const PERSONAS = [
  { name: 'Mia Chen', email: '[email protected]', plan: 'free' },
  { name: 'Liam Novak', email: '[email protected]', plan: 'pro' },
  { name: 'Sofia Ricci', email: '[email protected]', plan: 'free' },
  { name: 'Noah Fischer', email: '[email protected]', plan: 'pro' },
  { name: 'Emma Kovacs', email: '[email protected]', plan: 'free' },
  { name: 'Lucas Moreau', email: '[email protected]', plan: 'enterprise' },
  { name: 'Olivia Jansen', email: '[email protected]', plan: 'free' },
  { name: 'Ethan Silva', email: '[email protected]', plan: 'pro' },
  { name: 'Ava Lindberg', email: '[email protected]', plan: 'free' },
  { name: 'Marko Petrovic', email: '[email protected]', plan: 'pro' },
  { name: 'Hana Sato', email: '[email protected]', plan: 'free' },
  { name: 'Jonas Weber', email: '[email protected]', plan: 'enterprise' }
]

export function getDemoUser() {
  if (window.__DEMO_USER) return window.__DEMO_USER
  try {
    const stored = sessionStorage.getItem('shoply_demo_user')
    if (stored) return JSON.parse(stored)
    const user = PERSONAS[Math.floor(Math.random() * PERSONAS.length)]
    sessionStorage.setItem('shoply_demo_user', JSON.stringify(user))
    return user
  } catch {
    return PERSONAS[0]
  }
}