Packages

posthog-node

6.0.5 · 19 Nov 2026MIT23.9M / weekRepositorynpmAtom feed

Your version

5.43.0

15 Jul 2026Where it was published

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 on shutdown(). Core gains _sendMetricsBatch on PostHogCoreStateless (same outcome contract as _sendLogsBatch) and a shared resolveMetricsConfig, so any core-based SDK can host PostHogMetrics. (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.