The app works for me, ie it fetches the API key from the secret and appears to pass it correctly to the javascript function (which in turn stores it in “pfc”)
My guess would be that the pollfish API loads before the Anvil app has processed its show event, and expects those config variables to be immediately available. In your shoes I would just hard code the key – it’s not a secret (it’s available to everyone who visits your app), so there’s no sense making it complicated.
I would recommend removing the jQuery include (first line) – Anvil already includes jQuery, and you can come to grief by overwriting it with an incompatible version.
Oh so in this case the api key is exposed to the user anyways so it doesn’t matter if I bring it in with code or otherwise? Thank you, I will just hardcore it and call it at that.