mitjans / nuxt-posthog

Posthog module for Nuxt
https://nuxt-posthog.cmitjans.dev
MIT License
27 stars 3 forks source link

Enabled setting #24

Closed jonatandorozco closed 7 months ago

jonatandorozco commented 7 months ago

This will help to disable the capturing the working on dev, thus avoiding sending false positives to posthog.

mitjans commented 7 months ago

I'm not quite sure I understand the problem at hand @jonatandorozco If you don't want to have false positives when you are in the development environment I suggest one of 2 things:

Let me know if this helps!

jonatandorozco commented 7 months ago

Thanks @mitjans, how can it be disabled?

mitjans commented 7 months ago

By removing the environment variables POSTHOG_API_KEY and POSTHOG_API_HOST it should stop sending events to PostHog.

jonatandorozco commented 7 months ago

Thanks. I can work with that.

What do you think of having a config option to enable or disable the module?

It's more suitable as is preferable to have one setting to enable the whole feature rather than updating multiple ones. Additionally, this scenario is pretty standard in many modules

Some references:

https://sentry.nuxtjs.org/configuration/options#disabled https://nuxt-security.vercel.app/documentation/getting-started/configuration https://nuxt.com/modules/devtools#module-options https://github.com/nuxt-modules/plausible?tab=readme-ov-file#configuration

mitjans commented 7 months ago

Sounds like a good idea! I'll give it some time this weekend. Thank you for the suggestion ❤️

jonatandorozco commented 7 months ago

Thanks, @mitjans, if you need help with testing or something just let me know

And thank you for this package. Awesome work