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

before_send in Node.js not called by $identify

Open Laruxo opened this issue 1 month ago • 2 comments

Bug description

In posthog-js before_send is called for all events including $identify and $groupidentify. Meanwhile, in posthog-node, it is only called for capture* functions.

How to reproduce

  1. Add before_send(event) { console.log(event); return event } handler on the server
  2. Call postHog.identify(...)
  3. Nothing is logged to the console

Related sub-libraries

  • [ ] All of them
  • [ ] posthog-js (web)
  • [ ] posthog-js-lite (web lite)
  • [x] posthog-node
  • [ ] posthog-react-native
  • [ ] @posthog/react
  • [ ] @posthog/ai
  • [ ] @posthog/nextjs-config

Laruxo avatar Nov 04 '25 10:11 Laruxo