How can I pass a dynamically updated token from Wix’s Custom Code to the frontend in Wix Velo?

In Wix, I use Custom Code (found under Settings), which allows me to insert JavaScript either in the head or body of the site. I’m generating a token via an external service, and this token updates frequently during the user session. I need a reliable method to pass this dynamically changing token from the Custom Code section to the frontend of Wix Velo, where I can access it for further use.

The goal is to ensure that the frontend in Wix Velo always has access to the most up-to-date token. What would be the best practice or solution to achieve this real-time data transfer?