mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-28 08:49:42 +02:00
feat: add posthog signup and signin events, enable backend posthog events for oss version (#249)
This commit is contained in:
parent
9298116887
commit
f7c1f63e1b
10 changed files with 82 additions and 35 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from loguru import logger
|
||||
from posthog import Posthog
|
||||
|
||||
from api.constants import POSTHOG_API_KEY, POSTHOG_HOST
|
||||
from api.constants import ENABLE_TELEMETRY, POSTHOG_API_KEY, POSTHOG_HOST
|
||||
|
||||
_posthog_client: Posthog | None = None
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ _posthog_client: Posthog | None = None
|
|||
def get_posthog() -> Posthog | None:
|
||||
"""Return the lazily-initialised PostHog client, or None if not configured."""
|
||||
global _posthog_client
|
||||
if _posthog_client is None and POSTHOG_API_KEY:
|
||||
if _posthog_client is None and POSTHOG_API_KEY and ENABLE_TELEMETRY:
|
||||
_posthog_client = Posthog(POSTHOG_API_KEY, host=POSTHOG_HOST)
|
||||
return _posthog_client
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue