The beautiful function
wp_localize_script() was built for l11n, however its found as a method for carrying over server-side values into client-side JS.
Your values are now available in your
Currently using this in a React theme I’m building for WordPress.
This can also be done with something like: