Geez I feel ridiculous asking this question but here goes:
I have a client-side file config.js that has some variables that change between development and production deployments. Here’s an example:
var myConfig = { stripePublicKey: "abc123" };
I include config.js very early on in my page like so:
<script src="scripts/config.js"></script>
Now I’d like to use the variable myConfig.stripePublicKey in a flow. How do I do that? I’ve tried {{myConfig.stripePublicKey}}, myConfig.stripePublicKey, and even using eval.
@George you might find it interesting that the answer to this question is difficult for me to find on my own. As far as I can tell it’s not addressed in the documentation.
Your solution works correctly, you indeed need to wait for the DOMContentLoaded to set a variable on the app. An alternative is to set it on the global scope, you then don’t have to wait on the event and can set it directly. Of course the dmxAppConnect script should be loaded first.