Is there a legit way to check if Posthog has been initialised somewhere in the app?
My NextJS application structure is like that:
_app.tsx
-> posthog init inside useEffectMyComponent
-> event capture
My event capture from MyComponent
is being initialised before posthog init from _app.tsx
and thats why I am not able to record that event. I am just missing those events.
Any hints would be appreciate.
I am also wondering if I place two init functions, one in _app.tsx
and one inside MyComponent
, would that be a problem?
I would use the same keys and everything. Would I end with two different instances of posthog?
You can use
posthog.__loaded
like this