Add twig in header/footer
To inject dynamic data outside of the page content, you can use direct code in header.php or footer.php to render the dynamic content:
<?php echo \AlexaCRM\Nextgen\TwigProvider::instance()->renderString('Hello, {{ user.record["fullname"] }}'); ?>