Skip to content

@flags-sdk/posthog: upgrade posthog-node; explicit evaluation modes#436

Open
dferber90 wants to merge 8 commits into
mainfrom
update-posthog
Open

@flags-sdk/posthog: upgrade posthog-node; explicit evaluation modes#436
dferber90 wants to merge 8 commits into
mainfrom
update-posthog

Conversation

@dferber90

Copy link
Copy Markdown
Collaborator

The default adapter passed POSTHOG_PERSONAL_API_KEY into the runtime
posthog-node client, which enabled local evaluation and started a
feature-flag poller in every warm process. On serverless this produced
large, traffic-independent PostHog feature flag request volume.

Local evaluation is now opt-in via POSTHOG_SECRET_KEY; without it the
adapter evaluates remotely. POSTHOG_PERSONAL_API_KEY is used only by
getProviderData (Flags Explorer) and no longer affects runtime
evaluation. Drops the forced 10s poll interval in favor of the v5
default. Updates docs, README, and tests.

closes #393

The default adapter passed POSTHOG_PERSONAL_API_KEY into the runtime
posthog-node client, which enabled local evaluation and started a
feature-flag poller in every warm process. On serverless this produced
large, traffic-independent PostHog feature flag request volume.

Local evaluation is now opt-in via POSTHOG_SECRET_KEY; without it the
adapter evaluates remotely. POSTHOG_PERSONAL_API_KEY is used only by
getProviderData (Flags Explorer) and no longer affects runtime
evaluation. Drops the forced 10s poll interval in favor of the v5
default. Updates docs, README, and tests.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
flags-playground Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am
flags-sdk-dev Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am
flags-sdk-snippets Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am
flags-sdk-sveltekit-snippets Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am
shirt-shop Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am
shirt-shop-api Ready Ready Preview, Comment, Open in v0 Jul 21, 2026 9:41am

@socket-security

socket-security Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​posthog-node@​5.45.09110079100100

View full report

@vincent-derks vincent-derks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found some issues:

  • 5.45.0 has "engines": { "node": "^20.20.0 || >=22.22.0" }. It used to support >=15. Quite the jump. Should we at least document that? Or maybe also define an engines field mirroring that in packages/adapter-posthog/package.json?
  • 5.45.0 has deprecated isFeatureEnabled, getFeatureFlag, and getFeatureFlagPayload in favor of evaluateFlags. I think this might spam some deprecation warnings now. Should we also migrate to evaluateFlags? Since it's already a major update, that might fit.

Comment thread packages/adapter-posthog/package.json Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we should also remove this

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.

PostHog adapter starts local-evaluation polling when POSTHOG_PERSONAL_API_KEY is set

2 participants