<script>
  <?php if ($kirby->user()): ?>
  const kirbyData = {
    user: {
      role: '<?= $kirby->user()->role() ?>',
      uuid: '<?= $kirby->user()->uuid() ?>',
      <?php if ($kirby->user()->role() == 'client'): ?>
        client: {
          name: '<?= $kirby->user()->client()->toPage()->title() ?>',
          uuid: '<?= $kirby->user()->client()->toPage()->uuid() ?>',
        }
      <?php endif ?>
    }
  }
  <?php endif ?>
</script> 
</body>
</html>