Filament::registerScripts() with blade variables?

Hi I understand we can load extra js script with something like this

Filament::registerScripts([
    asset('js/my-script.js'),
]);


However what I wanted to do is something like this

<script src="js/my-script.js"></script>
<script>
analytics.send({email: '{{ auth()->user()->email }}'});
</script>


The 1st line is straight forward but how do i do the 2nd script where i will be throwing in various blade variables? do I just do {{ auth()->user()->email }} in my public/analytics.js file?
Was this page helpful?