Open aroman opened 4 months ago
from a quick skim of the source, it looks like the answer to my question is "no, don't do that"
however, I'd love for someone on the posthog team to chime in here as to the recommended best practice when a user's distinct ID is not known immediately
is it safe to call posthog methods (e.g.
posthog.capture
) beforeposthog.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 toposthog.initialize({bootstrap: distinctId})