posthog-node
6.0.5 · 19 Nov 2026MIT23.9M / weekRepositorynpmAtom feed
5.74.0 is the newest release of 5.x.
In short
1 new1 internal
Release note
Minor Changes
Add the posthog.metrics API (count, gauge, histogram) to posthog-node — alpha
Backend services can now record metrics through the same statsd-style pre-aggregating client the browser SDK ships, with no OpenTelemetry setup:
const client = new PostHog('phc_...', { metrics: { serviceName: 'billing-worker' } }) client.metrics.count('invoices.processed', 1, { attributes: { plan: 'pro' } }) client.metrics.gauge('queue.depth', 42) client.metrics.histogram('job.duration', 187, { unit: 'ms' })Samples aggregate in memory and flush as OTLP/JSON to
/i/v1/metrics(one data point per series per window). Pending metrics are flushed onshutdown(). Core gains_sendMetricsBatchonPostHogCoreStateless(same outcome contract as_sendLogsBatch) and a sharedresolveMetricsConfig, so any core-based SDK can hostPostHogMetrics. (2026-07-15)
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.