Note: The Node.js SDK code has moved to hanzoai/insights-js — use
@hanzo/insights-nodeinstead.
Fork of PostHog/posthog-node (now deprecated upstream — code lives in posthog-js monorepo).
npm install @hanzo/insights-nodeimport { Insights } from '@hanzo/insights-node'
const insights = new Insights('YOUR_API_KEY', {
host: 'https://insights.hanzo.ai'
})
insights.capture({
distinctId: 'user_123',
event: 'signed_up',
properties: { plan: 'pro' }
})
await insights.shutdown()This is a branded fork. Active development is in hanzoai/insights-js/packages/node.
To sync upstream:
git remote add upstream https://github.com/PostHog/posthog-node.git
git fetch upstream
git merge upstream/main