@posthog/convex
2.1.9
Patch Changes
- #5626
44e6251Thanks @luantaraschi! - Relative date filters in local flag evaluation no longer roll past the end of a shorter month.1mon March 31 now resolves to February 28, matching the flags service. (2026-11-10) - Updated dependencies [
44e6251]:- @posthog/core@1.67.1
- posthog-node@5.67.1
2.1.8
Patch Changes
- #5354
f827137Thanks @marandaneto! - Fall back instead of returning inconsistent local regex flag results for Unicode and advanced patterns. (2026-10-23) - Updated dependencies [
faacff0,f827137]:- posthog-node@5.57.1
- @posthog/core@1.60.1
2.1.7
Patch Changes
- #5350
17260e5Thanks @marandaneto! - Fall back from local flag evaluation when a required property value is undefined. (2026-10-21) - Updated dependencies [
17260e5]:- @posthog/core@1.59.3
- posthog-node@5.56.4
2.1.6
Patch Changes
- #5307
189da75Thanks @quotentiroler! - Local flag evaluation now matches a null property with string operators like the flags service, so negated operators such asnot_icontainsmatch instead of failing. (2026-10-21) - Updated dependencies [
189da75]:- @posthog/core@1.59.2
- posthog-node@5.56.3
2.1.5
Patch Changes
- #4800
aad7464Thanks @marandaneto! - Respect the definitions response'sproperty_matching_versionduring local feature flag evaluation. Version 2 uses explicit boolean/string equality and per-member array matching, while missing or other versions retain service legacy matching (including empty-array truthiness). Preserve the version in Node definition caches and Convex persisted definitions, and propagate it through person, group, cohort and dependency evaluation without mixing snapshots during reloads. Existing numeric ambiguity fallback and SemVer parsing policies are unchanged. (2026-09-21) - Updated dependencies [
9cd8ebd,aad7464]:- @posthog/core@1.55.1
- posthog-node@5.52.5
2.1.4
Patch Changes
- #4661
444bf35Thanks @marandaneto! - Match local feature flag string operators, exact-value coercion, and JSON stringification with the flags service. (2026-09-01) - Updated dependencies [
444bf35,6ae173f,6723395]:- @posthog/core@1.50.0
- posthog-node@5.51.5
2.1.3
Patch Changes
- #4651
e899b1cThanks @marandaneto! - Treat omitted local evaluation properties as inconclusive foris_not_set. (2026-08-27) - Updated dependencies [
7902e44,e899b1c]:- @posthog/core@1.48.12
- posthog-node@5.51.3
2.1.2
Patch Changes
- #4610
930de19Thanks @marandaneto! - Share feature flag matching, hashing, variant, and payload evaluation helpers across the Node.js and Convex SDKs without changing their runtime-specific SemVer behavior. (2026-08-25) - Updated dependencies [
1faeb74,930de19,d4eee8f]:- posthog-node@5.51.2
- @posthog/core@1.48.11
2.1.1
Patch Changes
- #4578
bae46bfThanks @marandaneto! - Drop events when a before-send hook throws instead of sending the unmodified event. (2026-08-20) - Updated dependencies [
bae46bf,aef2f49]:- @posthog/core@1.48.6
- posthog-node@5.49.2
2.1.0
Minor Changes
- #4342
fa3457fThanks @haacked! - Support thestarts_with,not_starts_with,ends_with, andnot_ends_withproperty filter operators in feature flag local evaluation. Matching is case-insensitive and mirrorsicontains, so flags using these operators no longer fall back to remote evaluation. (2026-08-05)
Patch Changes
- Updated dependencies [
fa3457f]:
2.0.33
Patch Changes
- #4247
3b2e68dThanks @marandaneto! - Flush feature flag access events before remote evaluation actions return. (2026-07-27)
2.0.32
Patch Changes
- #4061
cc01eeaThanks @turnipdabeets! - Gate the feature-flag local-evaluation refresh loop so it no longer runs on installs that don't use it. The self-rescheduling loop and its 5-minute supervisor now no-op unlessPOSTHOG_PERSONAL_API_KEYis set — event-only and remote-flag projects no longer incur ~3k/day skipped scheduled executions or the log churn they produced. AddsPOSTHOG_DISABLE_LOCAL_EVALUATIONas an explicit off-switch for projects that set a key but don't want the background poll. Behavior is unchanged when a key is configured. (2026-07-03)
2.0.31
Patch Changes
-
#4021
89d486cThanks @richardsolomou! - FixPOSTHOG_FLAGS_POLLING_INTERVAL_SECONDSbeing ignored. The flag-refresh interval was read when the cron was registered, but Convex forwards component env vars only at runtime, so the value was always empty there and the cron was pinned to the 60s default. The refresh now runs as a self-rescheduling loop that reads the interval at runtime, with a supervisor cron that keeps the loop alive, so the configured interval is honoured.Fixes #3957. (2026-07-01)
2.0.30
Patch Changes
- #4006
0063128Thanks @github-actions! - AddgroupIdentifyImmediate()to await the network request when identifying a group, mirroringcaptureImmediate/identifyImmediate/aliasImmediate. Useful in edge/serverless environments where the background queue may not flush. The Convex integration now uses it directly instead of routing$groupidentifythroughcaptureImmediate. (2026-06-30) - Updated dependencies [
0063128]:- @posthog/core@1.39.0
- posthog-node@5.39.0
2.0.29
Patch Changes
- #3886
e6d7fe2Thanks @marandaneto! - Stop sending deprecated no-op top-leveltype,library, andlibrary_versionfields in event batch payloads. Useproperties.$libandproperties.$lib_versionfor SDK metadata; legacy queuedlibraryandlibrary_versionvalues are used as fallbacks when the official$properties are missing. (2026-06-18) - Updated dependencies [
e6d7fe2]:- @posthog/core@1.35.2
- posthog-node@5.38.1
2.0.28
Patch Changes
- Updated dependencies []:
- @posthog/core@1.32.3
- posthog-node@5.36.17
2.0.27
Patch Changes
- Updated dependencies [
25822ac]:- @posthog/core@1.32.2
- posthog-node@5.36.16
2.0.26
Patch Changes
- Updated dependencies []:
- @posthog/core@1.32.1
- posthog-node@5.36.15
2.0.25
Patch Changes
- Updated dependencies [
612f97a]:- @posthog/core@1.32.0
- posthog-node@5.36.14
2.0.24
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.4
- posthog-node@5.36.13
2.0.23
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.3
- posthog-node@5.36.12
2.0.22
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.2
- posthog-node@5.36.11
2.0.21
Patch Changes
- Updated dependencies []:
- @posthog/core@1.31.1
- posthog-node@5.36.10
2.0.20
Patch Changes
- Updated dependencies [
0c2acb9]:- @posthog/core@1.31.0
- posthog-node@5.36.9
2.0.19
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.14
- posthog-node@5.36.8
2.0.18
Patch Changes
- #3748
7820929Thanks @marandaneto! - Reduce duplicate internal code found by dry4ts. (2026-06-09) - Updated dependencies [
7820929]:- posthog-node@5.36.7
- @posthog/core@1.30.13
2.0.17
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.12
- posthog-node@5.36.6
2.0.16
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.11
- posthog-node@5.36.5
2.0.15
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.10
- posthog-node@5.36.4
2.0.14
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.9
- posthog-node@5.36.3
2.0.13
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.8
- posthog-node@5.36.2
2.0.12
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.7
- posthog-node@5.36.1
2.0.11
Patch Changes
- Updated dependencies [
9287c87]:
2.0.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.6
- posthog-node@5.35.15
2.0.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.5
- posthog-node@5.35.14
2.0.8
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.4
- posthog-node@5.35.13
2.0.7
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.3
- posthog-node@5.35.12
2.0.6
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.2
- posthog-node@5.35.11
2.0.5
Patch Changes
- Updated dependencies []:
- @posthog/core@1.30.1
- posthog-node@5.35.10
2.0.4
Patch Changes
- Updated dependencies [
f3cc6fa,3d4a76f]:- posthog-node@5.35.9
- @posthog/core@1.30.0
2.0.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.15
- posthog-node@5.35.8
2.0.2
Patch Changes
- Updated dependencies [
d9ad199]:- @posthog/core@1.29.14
- posthog-node@5.35.7
2.0.1
Patch Changes
-
#3684
714ffa5Thanks @richardsolomou! - Fix the refresh cron not registering whenPOSTHOG_PERSONAL_API_KEYis forwarded from the installing app. Convex only forwards component env vars at runtime, so the previous load-time gate saw an empty value during deploy-time module analysis and silently dropped the cron. The cron now registers unconditionally and gates at runtime.Fixes #3683. (2026-05-28)
-
Updated dependencies [
7b84b75]:- @posthog/core@1.29.13
- posthog-node@5.35.6
2.0.0
Major Changes
-
#3662
4285c40Thanks @richardsolomou! - v2 moves credentials onto the component via Convex 1.39's typed env-var config, bundles the flag-definitions refresh cron inside the component, and renamesPOSTHOG_API_KEY→POSTHOG_PROJECT_TOKEN.Breaking changes:
- Requires Convex
^1.39.0(peer dependency bumped). POSTHOG_API_KEYenv var renamed toPOSTHOG_PROJECT_TOKEN, to clearly differentiate the project token (phc_…) fromPOSTHOG_PERSONAL_API_KEY(phx_…/phs_…).POSTHOG_PROJECT_TOKENis now required at deploy time (Convex env validation enforces it); v1 silently no-op'd missing-token event sends at runtime.apiKey,host, andpersonalApiKeyno longer accepted on thePostHogclient constructor — declare them as env vars on the component instead.apiKeyandhostare no longer arguments to the component's actions (capture,identify,evaluateFlag, etc.).refreshFlagDefinitionsno longer takes any arguments.- The refresh cron is now registered inside the component and only fires when
POSTHOG_PERSONAL_API_KEYis set — delete any app-levelconvex/crons.tsthat existed only to refresh PostHog flags. posthog.refreshFlagDefinitions(ctx)renamed toposthog.reloadFeatureFlags(ctx)for parity withposthog-node.- Local-eval methods (
getFeatureFlag,isFeatureEnabled, etc.) now throw whenPOSTHOG_PERSONAL_API_KEYisn't configured, pointing callers at the remoteevaluateFlagmethods. They still returnundefinedduring the warm-up window when PAK is set but the cron hasn't fetched yet. - New optional
POSTHOG_FLAGS_POLLING_INTERVAL_SECONDSenv var lets you tune the cron cadence (default 60 seconds). Raise it on free-tier dev deployments to reduce function-call usage.
See the migration guide in the README for the full diff. (2026-05-27)
- Requires Convex
1.0.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.12
- posthog-node@5.35.5
1.0.9
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.11
- posthog-node@5.35.4
1.0.8
Patch Changes
- Updated dependencies [
5568f12]:- @posthog/core@1.29.10
- posthog-node@5.35.3
1.0.7
Patch Changes
- Updated dependencies [
5d7a2d3]:
1.0.6
Patch Changes
- Updated dependencies [
c806cca]:- @posthog/core@1.29.9
- posthog-node@5.35.1
1.0.5
Patch Changes
- Updated dependencies [
18ea8b5]:- posthog-node@5.35.0
- @posthog/core@1.29.8
1.0.4
Patch Changes
- Updated dependencies [
f42f371]:
1.0.3
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.7
- posthog-node@5.34.9
1.0.2
Patch Changes
- Updated dependencies [
12ef3f6]:
1.0.1
Patch Changes
- Updated dependencies [
a880dbc]:- @posthog/core@1.29.6
- posthog-node@5.34.7
1.0.0
Major Changes
-
#3622
a1a668eThanks @richardsolomou! - Feature flags are now evaluated locally in the Convex runtime instead of via a per-call action to PostHog. Your app schedules a cron that callsposthog.refreshFlagDefinitions(ctx)on whatever interval suits you; the component fetches/flags/definitions, caches the result in a Convex table, and feature flag methods read from that cache and evaluate flags in-process. Methods work in queries (not just actions) and benefit from Convex's reactivity — a query reading a flag re-runs automatically when definitions change.Setup: pass the keys through
new PostHog(components.posthog, { apiKey, personalApiKey, host })in yourconvex/posthog.ts. Convex components run in an isolated env namespace, so the client captures the keys at construction time and forwards them to the component whenrefreshFlagDefinitions(ctx)is called. Add aconvex/crons.tsthat schedulesposthog.refreshFlagDefinitions(ctx)— see the README for the exact shape.Two evaluation paths in this release. Pick the one that fits the flag:
- Local (
getFeatureFlag,isFeatureEnabled,getFeatureFlagPayload,getFeatureFlagResult,getAllFlags,getAllFlagsAndPayloads) — query/mutation/action context, no per-call round trip, reactive. RequirespersonalApiKey. Returnsnull/undefinedwhen local eval can't reach a verdict (experience continuity, static cohorts, theis_not_setoperator, or properties you don't pass in). - Remote (
evaluateFlag,evaluateFlagPayload,evaluateAllFlags) — action context only. Hits PostHog's/flagsendpoint directly viaposthog-node'sevaluateFlags. NopersonalApiKeyneeded. Handles every flag.
Breaking changes in this major release:
- Feature flag methods (
getFeatureFlag,isFeatureEnabled,getFeatureFlagPayload,getFeatureFlagResult,getAllFlags,getAllFlagsAndPayloads) now accept any context withrunQuery(queries, mutations, or actions) instead of requiring an action context. - Methods return
undefined(or empty objects for the all-flags methods) when local evaluation can't reach a verdict. They no longer fall back to a server/flagsrequest. - The
sendFeatureFlagEventsoption has been removed; with local evaluation there is no server-side/flagscall to emit those events. - The component now declares a
flagDefinitionstable — re-deploy the component to apply the schema change. - The component no longer ships its own cron. Consumers schedule the refresh themselves via
convex/crons.ts, which makes the polling interval explicit and gives the parent app's env vars a way to reach the action. (2026-05-19)
- Local (
Patch Changes
- Updated dependencies [
e119eec]:
0.2.33
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.5
- posthog-node@5.34.5
0.2.32
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.4
- posthog-node@5.34.4
0.2.31
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.3
- posthog-node@5.34.3
0.2.30
Patch Changes
- Updated dependencies []:
- @posthog/core@1.29.2
- posthog-node@5.34.2
0.2.29
Patch Changes
- Updated dependencies [
4b895bf]:- @posthog/core@1.29.1
- posthog-node@5.34.1
0.2.28
Patch Changes
- Updated dependencies [
ad60818]:- @posthog/core@1.29.0
- posthog-node@5.34.0
0.2.27
Patch Changes
- Updated dependencies [
223d925]:- @posthog/core@1.28.7
- posthog-node@5.33.7
0.2.26
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.6
- posthog-node@5.33.6
0.2.25
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.5
- posthog-node@5.33.5
0.2.24
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.4
- posthog-node@5.33.4
0.2.23
Patch Changes
- Updated dependencies []:
- @posthog/core@1.28.3
- posthog-node@5.33.3
0.2.22
Patch Changes
- Updated dependencies [
220cd61,255b273]:- @posthog/core@1.28.2
- posthog-node@5.33.2
0.2.21
Patch Changes
- Updated dependencies [
8aee3d5]:- @posthog/core@1.28.1
- posthog-node@5.33.1
0.2.20
Patch Changes
- Updated dependencies [
f8bc02f]:
0.2.19
Patch Changes
- Updated dependencies [
cf56753,04db756]:- @posthog/core@1.28.0
- posthog-node@5.32.1
0.2.18
Patch Changes
- Updated dependencies [
70ba8f8]:
0.2.17
Patch Changes
- Updated dependencies [
974e4b2]:
0.2.16
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.9
- posthog-node@5.30.8
0.2.15
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.8
- posthog-node@5.30.7
0.2.14
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.7
- posthog-node@5.30.6
0.2.13
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.6
- posthog-node@5.30.5
0.2.12
Patch Changes
- Updated dependencies [
70508df]:- @posthog/core@1.27.5
- posthog-node@5.30.4
0.2.11
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.4
- posthog-node@5.30.3
0.2.10
Patch Changes
- Updated dependencies []:
- @posthog/core@1.27.3
- posthog-node@5.30.2
0.2.9
Patch Changes
- Updated dependencies [
daf028d]:- @posthog/core@1.27.2
- posthog-node@5.30.1
0.2.8
Patch Changes
- Updated dependencies [
eadbcd7]:
0.2.7
Patch Changes
- Updated dependencies [
96f19b7]:- @posthog/core@1.27.1
- posthog-node@5.29.7
0.2.6
Patch Changes
- Updated dependencies [
1a8b727]:- @posthog/core@1.27.0
- posthog-node@5.29.6
0.2.5
Patch Changes
- Updated dependencies [
922a1c1]:- @posthog/core@1.26.0
- posthog-node@5.29.5
0.2.4
Patch Changes
- Updated dependencies [
b26c57c]:
0.2.3
Patch Changes
- #3426
1a0b58dThanks @marandaneto! - Trim surrounding whitespace from user-provided API keys, personal API keys, and host config values before using them. (2026-04-21) - Updated dependencies [
1a0b58d]:- @posthog/core@1.25.3
- posthog-node@5.29.3
0.2.2
Patch Changes
- Updated dependencies [
c735b08]:- @posthog/core@1.25.2
- posthog-node@5.29.2
0.2.1
Patch Changes
- Updated dependencies [
57ee5b2]:- @posthog/core@1.25.1
- posthog-node@5.29.1
0.2.0
Minor Changes
- #3302
fc5589fThanks @dmarticus! - preserve $set_once semantics in local flag evaluation cache (2026-04-07)
Patch Changes
- Updated dependencies [
fc5589f]:- @posthog/core@1.25.0
- posthog-node@5.29.0
0.1.19
Patch Changes
- Updated dependencies [
a01a3d5]:- @posthog/core@1.24.6
- posthog-node@5.28.11
0.1.18
Patch Changes
- #3309
197eedaThanks @marandaneto! - Extract CLI and sourcemap utilities from @posthog/core into @posthog/plugin-utils to remove cross-spawn from React Native dependencies (2026-04-01) - Updated dependencies [
197eeda]:- @posthog/core@1.24.5
- posthog-node@5.28.10
0.1.17
Patch Changes
- Updated dependencies [
a863914]:- @posthog/core@1.24.4
- posthog-node@5.28.9
0.1.16
Patch Changes
- Updated dependencies [
4bdfdbc]:- @posthog/core@1.24.3
- posthog-node@5.28.8
0.1.15
Patch Changes
- Updated dependencies [
8d34289]:- @posthog/core@1.24.2
- posthog-node@5.28.7
0.1.14
Patch Changes
- Updated dependencies [
5784dca]:
0.1.13
Patch Changes
- Updated dependencies [
314120a]:- @posthog/core@1.24.1
- posthog-node@5.28.5
0.1.12
Patch Changes
- Updated dependencies [
9cd2313]:- @posthog/core@1.24.0
- posthog-node@5.28.4
0.1.11
Patch Changes
- Updated dependencies [
697e423]:
0.1.10
Patch Changes
- Updated dependencies [
bc30c2d,bc30c2d,bc30c2d]:- @posthog/core@1.23.4
- posthog-node@5.28.2
0.1.9
Patch Changes
- #3226
a8ca323Thanks @richardsolomou! - fix: support $-prefixed property keys (e.g. $ai_model, $set) by JSON-serializing properties before passing through Convex's value system (2026-03-11) - Updated dependencies [
4009c15]:- @posthog/core@1.23.3
- posthog-node@5.28.1
0.1.8
Patch Changes
- Updated dependencies [
33e9fb4]:
0.1.7
Patch Changes
- Updated dependencies [
4601bbc]:
0.1.6
Patch Changes
- Updated dependencies [
2eff595]:
0.1.5
Patch Changes
- Updated dependencies [
5e8d5fc]:- @posthog/core@1.23.2
- posthog-node@5.26.2
0.1.4
Patch Changes
- Updated dependencies [
0dc03b0]:
0.1.3
Patch Changes
0.1.2
Patch Changes
- Updated dependencies [
301e75a]:
0.1.1
Patch Changes
- #3111
cb4351aThanks @richardsolomou! - Initial release of @posthog/convex - PostHog analytics integration for Convex (2026-02-18) - Updated dependencies [
9dbc05e]:- @posthog/core@1.23.1
- posthog-node@5.24.17
0.1.0
Minor Changes
- #3110
7a858f7Thanks @richardsolomou! - Initial release of @posthog/convex - PostHog analytics integration for Convex (2026-02-17)
0.1.0
Minor Changes
- #3077
25ea963Thanks @richardsolomou! - Initial release of @posthog/convex - PostHog analytics integration for Convex (2026-02-17)
Patch Changes
- Updated dependencies [
e962f01]:- @posthog/core@1.23.0
- posthog-node@5.24.16