posthog-js icon indicating copy to clipboard operation
posthog-js copied to clipboard

using the API before posthog.init() is called

Open aroman opened this issue 4 months ago • 1 comments

is it safe to call posthog methods (e.g. posthog.capture) before posthog.init() has been called? will they be queued and flushed when (and if) the posthog client is eventually initialized?

I ask because we are considering moving to an architecture where we lazily initialize posthog once some async initial data is fetched (e.g. an initial distinctID for providing to posthog.initialize({bootstrap: distinctId})

aroman avatar Apr 09 '24 04:04 aroman