nuxt-matomo icon indicating copy to clipboard operation
nuxt-matomo copied to clipboard

[FEAT] use runtime config

Open Hulkmaster opened this issue 4 years ago • 2 comments

Problem: in our project we build nuxt in docker image, and we matomo vars in .env because of our architecture we cannot provide .env during build time, and thus we have to do hack specially for that plugin

Solution: Would be nice, if that plugin would use nuxt runtime config https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-runtime-config/

Hulkmaster avatar Jan 13 '21 09:01 Hulkmaster

Yes, supporting runtime config would be nice. Here's the documentation for how @nuxt/sentry allows configuring it

An alternative would be to do what other modules which is to allow not specifying siteId in the configuration object, and instead falling back to a pre-specified process.env value read at runtime (i.e. is not baked in by nuxt/webpack). Something like process.env.MATOMO_SITE_ID. This is how @nuxt/sentry does it too

dhritzkiv avatar Apr 08 '21 22:04 dhritzkiv

This fork does exactly that: https://github.com/zecar/nuxt-matomo :fire:

gb-bluspark avatar Jun 12 '24 10:06 gb-bluspark