Open tompscanlan opened 3 months ago
Oh... I may have found it... distinctId
is different than distinct_id
. Changing that seems to make the difference.
Chalking this one up to new-userism... might want a documentation change at https://posthog.com/docs/libraries/node. Seeing distinct_id
so much stuck in my head. maybe switch up the examples, or get smarter users.
I think we should perhaps do some more SDK side alerting if a call happens without a distinctId
. Most people seem to use Typescript which indicates this immediately but we may need to rely on that less...
Bug description
In a minimal node http handler I'm trying to use posthog to capture an event. I'm seeing a ~10 second timeout when waiting on the call to shutdown(). At that time I get the error:
ERROR Error while shutting down PostHog HTTP error while fetching PostHog: 400
at retriable (node_modules/posthog-core/src/index.ts:652:17) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at retriable (node_modules/posthog-core/src/utils.ts:27:19) at PostHog.fetchWithRetry (node_modules/posthog-core/src/index.ts:635:12) at PostHog._flush (node_modules/posthog-core/src/index.ts:605:7)
How to reproduce
This is a Nuxt project backend running in node 20.
Additional context
I'm not to posthog, and a hack front end person, I'm probably doing something silly. I'm getting front end events through just fine using the same api key, but none of my backend events show up, and get a 400 instead.