Skip to content

chore(deps): upgrade PostHog SDKs to latest (posthog-node major v3→v5)#313

Open
ntotten wants to merge 1 commit into
mainfrom
claude/upgrade-posthog-sdk
Open

chore(deps): upgrade PostHog SDKs to latest (posthog-node major v3→v5)#313
ntotten wants to merge 1 commit into
mainfrom
claude/upgrade-posthog-sdk

Conversation

@ntotten

@ntotten ntotten commented Jun 8, 2026

Copy link
Copy Markdown
Member

Upgrades the PostHog SDKs to their latest releases.

Workspace Package From To
apps/api posthog-node ^3.1.1 ^5.36.5
apps/web posthog-js ^1.91.1 ^1.383.0

posthog-node v3 → v5 review (apps/api)

Usage is confined to src/services/posthog.ts and src/lib/rating.worker.ts:

  • new PostHog(key, { host }) and .capture({ distinctId, properties, event }) — both stable across v3/v4/v5.
  • The if (process.env.POSTHOG_KEY) guard satisfies v5's new non-empty-key requirement.
  • No use of feature flags, captureMode, personProperties/groupProperties, shutdown(), or compression — so none of the v4/v5 breaking changes apply.

Verified apps/api typechecks against posthog-node v5.

posthog-js (apps/web)

Uses init / capture / identify / PostHogProvider — all stable across the v1 line. The new transitive deps in the lockfile (dompurify, preact, web-vitals, core-js) are posthog-js's own dependencies (sanitization, surveys/toolbar, web-vitals autocapture).

Note: tsc --build surfaces one pre-existing, unrelated error in apps/api/src/services/openai-response.ts (reasoning_effort — an OpenAI SDK type-lag the code already casts around). It is unchanged on main and untouched by this PR.

🤖 Generated with Claude Code

- apps/api: posthog-node ^3.1.1 → ^5.36.5 (major v3 → v5)
- apps/web: posthog-js ^1.91.1 → ^1.383.0

Reviewed posthog-node v3 → v5 breaking changes against usage:
- apps/api only calls `new PostHog(key, { host })` and
  `.capture({ distinctId, properties, event })` — both stable across
  v3/v4/v5. The empty-key guard satisfies v5's non-empty requirement.
- No use of feature flags, captureMode, personProperties, shutdown,
  or compression — none of the v4/v5 breaking changes apply.

posthog-js (web) uses init/capture/identify/PostHogProvider, all stable
across v1. New transitive deps (dompurify/preact/web-vitals/core-js) are
posthog-js's own dependencies. Verified apps/api typechecks against v5.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 21:36
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rate-my-openapi Ready Ready Preview, Comment Jun 8, 2026 9:39pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades PostHog client SDK dependencies across the monorepo, moving the API workspace to posthog-node v5 and the web workspace to a much newer posthog-js v1 release.

Changes:

  • Bump apps/api dependency posthog-node from ^3.1.1 to ^5.36.5.
  • Bump apps/web dependency posthog-js from ^1.91.1 to ^1.383.0.
  • Refresh package-lock.json to reflect new dependency trees (e.g., @posthog/core, dompurify, core-js, etc.).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
package-lock.json Updates resolved PostHog package versions and introduces new transitive dependencies + engine constraints.
apps/web/package.json Bumps posthog-js to the latest v1 line.
apps/api/package.json Bumps posthog-node to v5 (major upgrade).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/api/package.json
"fastify": "^4.21.0",
"js-yaml": "^4.1.0",
"posthog-node": "^3.1.1",
"posthog-node": "^5.36.5",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants