You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However other scripts like Google Maps or Stripe require to add the key manually:
Google Maps:
<scriptsetuplang="ts">const { $script } =useScriptGoogleMaps({ apiKey: 'key'// <---- This shouldnt be needed if configured in runtimeConfig })// ...</script>
Stripe:
<scriptsetuplang="ts">const { $script } =useScriptStripe()onMounted(() => {$script.then(({ Stripe }) => {const stripe =Stripe('YOUR_STRIPE_KEY'); // <---- This shouldnt be needed if configured in runtimeConfig// ... })})// ...</script>
Can we have all integrations configurable with .env and runtime config? Or maybe they are already but it is not documented?
The text was updated successfully, but these errors were encountered:
MickL
changed the title
Configure all integrations by .env
Configure all integrations by .env and runtimeConfig
Jul 20, 2024
Thanks for raising this, afaik it should just work but yes it will throw a TypeScript error. This does need to be fixed, I think we'd need to do runtime type augmentation if the env is provided.
If it works then it is just not documentated for some integrations, maybe you got it wrong it shouldnt be a bug :) It is either a feature request or docs missing.
Most integratiosn like Cloudflare Web Analytics or Google Analytics seem to be configurable by a very convinient way using
.env
file and nuxt config:However other scripts like Google Maps or Stripe require to add the key manually:
Google Maps:
Stripe:
Can we have all integrations configurable with .env and runtime config? Or maybe they are already but it is not documented?
The text was updated successfully, but these errors were encountered: