Node.js error tracking installation
Install the PostHog Node.js library using your package manager: Initialize the PostHog client with your project API key: Once installed, you can manually send events to test your integration: You can enable exception autocapture when initializing the PostHog client to automatically capture uncaught exceptions and unhandled rejections in your Node app. If you are using the Express framework, you will need to import and call Note: Error tracking requires access the file system to process stack traces. Some providers, like Cloudflare Workers, do not support Node.js runtime APIs by default and need to be included as per their documentation. If you need to manually capture exceptions, you can do so by calling the This is helpful if you've built your own error handling logic or want to capture exceptions normally handled by the framework.Install the package
RequiredInitialize PostHog
RequiredSend an event
RecommendedConfigure exception autocapture
RecommendedsetupExpressErrorHandler with your PostHog client and Express app. This is because Express handles uncaught exceptions internally meaning exception autocapture will not work by default.Manually capture exceptions
OptionalcaptureException method:

