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

Option to disable sending events and only log them

Open TriPSs opened this issue 1 year ago • 2 comments

During development it would be quite handy if we could disable the actual sending of events and only log what would have been send.

This will make implementing PostHog events easier and wont pollute the dashboard with test data.

TriPSs avatar Jul 25 '24 08:07 TriPSs

This is cool idea. How would you expect the SDK config to look like for this?

benjackwhite avatar Jul 25 '24 08:07 benjackwhite

The posthog-node SDK has a disabled option, maybe we can add that to? If debug is then enabled it will then log (like now) the events to the console.

TriPSs avatar Jul 25 '24 09:07 TriPSs

Yes, this would be great. Useful during development to make sure events would be correctly logged without having to test in a real environment and pollute production data.

alimony avatar Nov 08 '24 14:11 alimony

This would be possible using https://github.com/PostHog/posthog-js/pull/1515

I'll update the docs examples we're writing here https://github.com/PostHog/posthog.com/pull/9844

pauldambra avatar Nov 13 '24 12:11 pauldambra