How to inject variables into public-facing JS using wp_enqueue_script

I’m using wp_enqueue_script to enqueue the public-facing JS of my WP plugin:

And in the other side I have:

I would like, somehow, to set the name value to a value that I have access in the server side. Is this possible? Can someone point me to the documentation or an example of how to do that?