@flags-sdk/posthog: upgrade posthog-node; explicit evaluation modes#436
Open
dferber90 wants to merge 12 commits into
Open
@flags-sdk/posthog: upgrade posthog-node; explicit evaluation modes#436dferber90 wants to merge 12 commits into
dferber90 wants to merge 12 commits into
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
vincent-derks
left a comment
Contributor
There was a problem hiding this comment.
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 inpackages/adapter-posthog/package.json? - 5.45.0 has deprecated
isFeatureEnabled,getFeatureFlag, andgetFeatureFlagPayloadin favor ofevaluateFlags. I think this might spam some deprecation warnings now. Should we also migrate toevaluateFlags? Since it's already a major update, that might fit.
Contributor
There was a problem hiding this comment.
Maybe we should also remove this
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modernize the PostHog adapter. This release is breaking in four ways:
NEXT_PUBLIC_POSTHOG_KEY→POSTHOG_PROJECT_API_KEYandNEXT_PUBLIC_POSTHOG_HOST→POSTHOG_HOST.POSTHOG_SECRET_KEY.isFeatureEnabled()/featureFlagValue()/featureFlagPayload()becomepostHogAdapterandpostHogAdapter.payload.keyis used as the PostHog flag key verbatim, and Node.js^20.20.0 || >=22.22.0is now required.It also upgrades
posthog-nodefrom v4.11.1 to v5.45.0, adds bulk evaluation support,and drops
posthog-node's deprecation warnings.closes #393