Extends the sweep beyond packages/ to the whole repo (178 files): workflows,
.eslintrc, playground, examples, tooling, root docs. Zero upstream-brand refs and
zero such filenames outside the exemptions.
REVERTS A LICENSING ERROR (from earlier rebrand e43ab1af, not this sweep):
- LICENSE had its copyright holder rewritten to 'Insights'. Restored to the real
holder: 'Copyright 2020 Posthog / Hiberly, Inc.' (+ Mixpanel, Inc.).
- NOTICE credited a non-existent upstream (github.com/getinsights/insights-js).
Restored to the real one: github.com/PostHog/posthog-js.
Apache-2.0 4(c) requires retaining upstream attribution; rewriting a third
party's copyright line falsifies ownership. Both files are now excluded from the
guard and documented as exempt in LLM.md.
Also:
- Deleted junk: AGENTS.md~upstream_main (merge leftover), the now-obsolete
rebrand script; renamed upload-*-s3.ts tooling (still used by cli.ts).
- Removed 42 stale playground/example pnpm-lock.yaml files: they pinned upstream
packages the package.json no longer references. Regenerated on install —
sed-ing a lockfile would corrupt its integrity hashes.
- Guard renamed no-posthog.yml -> brand-guard.yml and now assembles the pattern
at runtime, so no filename or file content carries the string (the previous
guard was swept by its own rule, inverting it to forbid 'insights').
61 KiB
@hanzo/insights-node
5.35.11
Patch Changes
- Updated dependencies []:
5.35.10
Patch Changes
- Updated dependencies []:
5.35.9
Patch Changes
- #3703
f3cc6faThanks @marandaneto! - Disable/no-op initialization paths instead of throwing or sending requests when Insights project tokens are missing or blank. (2026-06-01) - Updated dependencies [
3d4a76f]:
5.35.8
Patch Changes
- Updated dependencies []:
5.35.7
Patch Changes
- Updated dependencies [
d9ad199]:
5.35.6
Patch Changes
- #3681
7b84b75Thanks @ablaszkiewicz! - unify captureException in insights core (2026-05-28) - Updated dependencies [
7b84b75]:
5.35.5
Patch Changes
- Updated dependencies []:
5.35.4
Patch Changes
- Updated dependencies []:
5.35.3
Patch Changes
- Updated dependencies [
5568f12]:
5.35.2
Patch Changes
- #3658
5d7a2d3Thanks @gustavohstrassburger! - Include group context in the $feature_flag_called deduplication key in _captureFlagCalledEventIfNeeded, so events fire independently per group combination. (2026-05-25)
5.35.1
Patch Changes
- Updated dependencies [
c806cca]:
5.35.0
Minor Changes
- #3642
18ea8b5Thanks @dustinbyrne! - Promote feature flag definition cache provider types to the maininsights-nodeexport and deprecateinsights-node/experimentalimports. (2026-05-21)
Patch Changes
- Updated dependencies []:
5.34.10
Patch Changes
- #3643
f42f371Thanks @dmarticus! - Reject semver values with leading zeros in local flag evaluation. Per semver 2.0.0 §2, numeric identifiers must not include leading zeros — values like1.07.3are not valid semver and should not match targeting conditions. Both override values and flag values are now validated; invalid inputs surface asInconclusiveMatchErrorso the condition does not match. (2026-05-21)
5.34.9
Patch Changes
- Updated dependencies []:
5.34.8
Patch Changes
- #3640
12ef3f6Thanks @hpouillot! - FixidentifyImmediateto await the underlying network request. Previously the returned promise resolved before the$identifyevent was sent, causing events to be dropped when called from short-lived runtimes (Vercel/Cloudflare Workers, Convex actions) that exit immediately afterawait. (2026-05-21)
5.34.7
Patch Changes
- Updated dependencies [
a880dbc]:
5.34.6
Patch Changes
- #3623
e119eecThanks @richardsolomou! - Fix six edge cases in local feature flag evaluation.gt/gte/lt/ltenow compare numerically when both sides parse as finite numbers — previously a string override like"10"against numeric value9slipped into lexicographic comparison and returned false, andparseFloat's NaN return value leaked through the old!= nullguard.is_not_setnow resolves locally — true when the property key is absent, false when present — instead of always throwingInconclusiveMatchErrorand forcing the flag to return undefined. Flag-level condition properties withnegation: trueare now correctly inverted, matching the existing cohort-path behavior inmatchPropertyGroup. An inactive flag (active: false) now short-circuits to false even whenensure_experience_continuity: true— previously it threwInconclusiveMatchErrorand resolved to undefined.is_setnow returns true for properties whose value isnullorundefinedas long as the key is present —is_setis about key presence, not value. Cohort property groups containing a flag-type property no longer silently skip the dependency; the cohort eval is now marked inconclusive so the flag returns undefined instead of a wrong definitive answer. (2026-05-19)
5.34.5
Patch Changes
- Updated dependencies []:
5.34.4
Patch Changes
- Updated dependencies []:
5.34.3
Patch Changes
- Updated dependencies []:
5.34.2
Patch Changes
- Updated dependencies []:
5.34.1
Patch Changes
- Updated dependencies [
4b895bf]:
5.34.0
Minor Changes
- #3599
ad60818Thanks @turnipdabeets! - Expose UUID and cookie helpers from@insights/coreandinsights-nodefor users managing distinct_id outside the browser SDK (e.g. Lambda functions handing out cross-domain redirects). The helpers were already implemented in@insights/next— this change lifts them to core so all SDKs can re-use them.@insights/nextnow re-exports the same surface from@insights/coreto keep existing consumers working without churn. Closes #2143. (2026-05-12)
Patch Changes
- Updated dependencies [
ad60818]:
5.33.7
Patch Changes
- Updated dependencies [
223d925]:
5.33.6
Patch Changes
- Updated dependencies []:
5.33.5
Patch Changes
- Updated dependencies []:
5.33.4
Patch Changes
- Updated dependencies []:
5.33.3
Patch Changes
- Updated dependencies []:
5.33.2
Patch Changes
- #3516
220cd61Thanks @marandaneto! - fix: consume fetch response body to prevent CF Workers runtime warnings (2026-05-04) - Updated dependencies [
220cd61,255b273]:
5.33.1
Patch Changes
- Updated dependencies [
8aee3d5]:
5.33.0
Minor Changes
-
#3476
f8bc02fThanks @dmarticus! - AddevaluateFlags()and a newflagsoption oncapture()so a single/flagsrequest powers both flag branching and event enrichment per incoming request:const flags = await insights.evaluateFlags(distinctId, { personProperties: { plan: 'enterprise' } }) if (flags.isEnabled('new-dashboard')) { renderNewDashboard() } insights.capture({ distinctId, event: 'page_viewed', flags })The returned
FeatureFlagEvaluationssnapshot exposesisEnabled(),getFlag(),getFlagPayload()for branching, plusonlyAccessed()andonly([keys])for filtering which flags get attached to a captured event. PassflagKeys: [...]toevaluateFlags()to scope the underlying/flagsrequest itself.captureException()/captureExceptionImmediate()accept aflagsargument so$exceptionevents carry the same flag context as the rest of your request's events.Deprecates
isFeatureEnabled(),getFeatureFlag(),getFeatureFlagPayload(), andcapture({ sendFeatureFlags }). They continue to work but now log a deduped[Insights] ... is deprecatedwarning the first time they're used. Removal is planned for the next major version. (2026-05-02)
5.32.1
Patch Changes
5.32.0
Minor Changes
- #3474
70ba8f8Thanks @patricio-insights! - feat(flags): support mixed targeting in local evaluation (2026-04-30)
5.31.0
Minor Changes
- #3491
974e4b2Thanks @dustinbyrne! - Add Express and NestJS request context support for Insights tracing headers. (2026-04-29)
5.30.8
Patch Changes
- Updated dependencies []:
5.30.7
Patch Changes
- Updated dependencies []:
5.30.6
Patch Changes
- Updated dependencies []:
5.30.5
Patch Changes
- Updated dependencies []:
5.30.4
Patch Changes
- Updated dependencies [
70508df]:
5.30.3
Patch Changes
- Updated dependencies []:
5.30.2
Patch Changes
- Updated dependencies []:
5.30.1
Patch Changes
- Updated dependencies [
daf028d]:
5.30.0
Minor Changes
- #3457
eadbcd7Thanks @hpouillot! - send relative file paths in frames (2026-04-23)
5.29.7
Patch Changes
- Updated dependencies [
96f19b7]:
5.29.6
Patch Changes
- Updated dependencies [
1a8b727]:
5.29.5
Patch Changes
- Updated dependencies [
922a1c1]:
5.29.4
Patch Changes
- #3407
b26c57cThanks @patricio-insights! - fix(flags): switch local evaluation polling from/api/feature_flag/local_evaluationto/flags/definitions(2026-04-21)
5.29.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]:
5.29.2
Patch Changes
- #3351
c735b08Thanks @dmarticus! - Send $device_id as a top-level field in /flags requests so the feature flags service can use it for device-based bucketing during remote evaluation (2026-04-09) - Updated dependencies [
c735b08]:
5.29.1
Patch Changes
- Updated dependencies [
57ee5b2]:
5.29.0
Minor Changes
- #3302
fc5589fThanks @dmarticus! - preserve $set_once semantics in local flag evaluation cache (2026-04-07)
Patch Changes
- Updated dependencies [
fc5589f]:
5.28.11
Patch Changes
- Updated dependencies [
a01a3d5]:
5.28.10
Patch Changes
- #3309
197eedaThanks @marandaneto! - Extract CLI and sourcemap utilities from @insights/core into @insights/plugin-utils to remove cross-spawn from React Native dependencies (2026-04-01) - Updated dependencies [
197eeda]:
5.28.9
Patch Changes
- Updated dependencies [
a863914]:
5.28.8
Patch Changes
- Updated dependencies [
4bdfdbc]:
5.28.7
Patch Changes
- Updated dependencies [
8d34289]:
5.28.6
Patch Changes
- #3282
5784dcaThanks @marandaneto! - fix: captureException now uses distinctId from request context (2026-03-26)
5.28.5
Patch Changes
- Updated dependencies [
314120a]:
5.28.4
Patch Changes
- Updated dependencies [
9cd2313]:
5.28.3
Patch Changes
- #3243
697e423Thanks @hpouillot! - fix captureExceptionImmediate return value (2026-03-18)
5.28.2
Patch Changes
-
#3236
bc30c2dThanks @dustinbyrne! - Omit the config query parameter by default to request only the necessary data (2026-03-13) -
#3236
bc30c2dThanks @dustinbyrne! - fix: Client shutdown awaits the feature flags poller to stop (2026-03-13)
5.28.1
Patch Changes
- Updated dependencies [
4009c15]:
5.28.0
Minor Changes
- #3197
33e9fb4Thanks @hpouillot! - Add nestjs integration with interceptor for context propagation (2026-03-05)
5.27.1
Patch Changes
- #3186
4601bbcThanks @dmarticus! - Add semver comparison operators to local feature flag evaluation: semver_eq, semver_neq, semver_gt, semver_gte, semver_lt, semver_lte, semver_tilde, semver_caret, and semver_wildcard (2026-03-05)
5.27.0
Minor Changes
- #3187
2eff595Thanks @dustinbyrne! - feat: Accept awaitUntilmethod for serverless environments (2026-03-04)
5.26.2
Patch Changes
- Updated dependencies [
5e8d5fc]:
5.26.1
Patch Changes
- #3163
0dc03b0Thanks @gustavohstrassburger! - Improve local feature flag evaluation debugging by adding timestamp tracking. Locally evaluated flags now include timing information in$feature_flag_calledevents to help debug cache TTL and timing issues, matching what's available for remote evaluation. (2026-03-02)
5.26.0
Minor Changes
-
#3144
d43e90dThanks @dustinbyrne! - feat: getFeatureFlagResult, getAllFlags, getAllFlagsAndPayloads now have context-sensitive overrides which do not requiredistinctIdas a parameter, instead reading it from the current context. (2026-02-25) -
#3144
d43e90dThanks @dustinbyrne! - feat: AddenterContext()to attach a context to the current async execution context (2026-02-25)
5.25.0
Minor Changes
- #3132
301e75aThanks @benjackwhite! - Officially adds support for super properties added with.register(it was available as a function but did not actually work previously) (2026-02-23)
5.24.17
Patch Changes
- #3107
9dbc05eThanks @ablaszkiewicz! - warning on manual capture('$exception') (2026-02-18) - Updated dependencies [
9dbc05e]:
5.24.16
Patch Changes
- Updated dependencies [
e962f01]:
5.24.15
Patch Changes
- Updated dependencies [
0acf16f]:
5.24.14
Patch Changes
- Updated dependencies [
d578824]:
5.24.13
Patch Changes
- #3056
846a7f2Thanks @richardsolomou! - feat: Add /edge subpath export for non-standard edge runtimes (2026-02-09)
5.24.12
Patch Changes
- Updated dependencies [
e055f9a]:
5.24.11
Patch Changes
- Updated dependencies [
8f75dae]:
5.24.10
Patch Changes
- Updated dependencies [
bb62809]:
5.24.9
Patch Changes
- Updated dependencies [
c99e5fe]:
5.24.8
Patch Changes
- Updated dependencies [
7768010]:
5.24.7
Patch Changes
- Updated dependencies [
727536c]:
5.24.6
Patch Changes
- Updated dependencies [
cbe84c1]:
5.24.5
Patch Changes
- #2987
25f4173Thanks @marandaneto! - fix: before_send in node inferred the type as any instead of EventMessage or null (2026-01-29)
5.24.4
Patch Changes
- Updated dependencies [
8c0c495]:
5.24.3
Patch Changes
- Updated dependencies [
f51560c]:
5.24.2
Patch Changes
- Updated dependencies [
933c763]:
5.24.1
Patch Changes
- Updated dependencies [
8a5a3d5]:
5.24.0
Minor Changes
- #2897
b7fa003Thanks @matheus-vb! - Add $feature_flag_error to $feature_flag_called events to track flag evaluation failures (2026-01-20)
Patch Changes
5.23.0
Minor Changes
-
#2900
23770e9Thanks @dmarticus! - RenamedevaluationEnvironmentstoevaluationContextsfor clearer semantics. The term "contexts" better reflects that this feature is for specifying evaluation contexts (e.g., "web", "mobile", "checkout") rather than deployment environments (e.g., "staging", "production").Deprecated
insights.initoptionevaluationEnvironmentsis now deprecated in favor ofevaluationContexts. The old property will continue to work and will log a deprecation warning. It will be removed in a future major version.
Migration Guide
// Before insights.init('<ph_project_api_key>', { evaluationEnvironments: ['production', 'web', 'checkout'], }) // After insights.init('<ph_project_api_key>', { evaluationContexts: ['production', 'web', 'checkout'], }) ``` (2026-01-19)
Patch Changes
- Updated dependencies [
23770e9]:
5.22.0
Minor Changes
- #2930
c9b773aThanks @marandaneto! - chore: Bump node min. ^20.20.0 || >=22.22.0 due to https://nodejs.org/en/blog/vulnerability/january-2026-dos-mitigation-async-hooks (2026-01-19)
5.21.2
Patch Changes
- #2920
099ee0cThanks @haacked! - Add getFeatureFlagResult method to retrieve flag value and payload in a single API call. (2026-01-19)
5.21.1
Patch Changes
- Updated dependencies [
d37e570]:
5.21.0
Minor Changes
-
#2883
640fcddThanks @ordehi! - Add warning when experience continuity flags are detected during local evaluation, and newstrictLocalEvaluationoption.Warning: When using local evaluation with flags that have experience continuity enabled, a warning is now emitted explaining that these flags will cause server requests on every evaluation, negating local evaluation cost savings.
New option:
strictLocalEvaluation: truecan be set at client init to prevent all server fallback for flag evaluations. Flags that cannot be evaluated locally will returnundefinedinstead of making a server request. This is useful in high-volume environments where you want to guarantee no unexpected server costs. (2026-01-14)
5.20.0
Minor Changes
- #2593
fba9fb2Thanks @daibhin! - track LLMA trace_id on exceptions and exception_id on traces (2026-01-08)
Patch Changes
- Updated dependencies [
fba9fb2,c1ed63b]:- @hanzo/[email protected]
5.19.0
Minor Changes
- #2840
84e4140Thanks @ordehi! - Add overrideFeatureFlags() method for local testing and development (2026-01-06)
5.18.1
Patch Changes
- #2825
5a4a8e2Thanks @haacked! - getFeatureFlag() respects exponential backoff for HTTP 401, 403, and 429 responses. (2025-12-30)
5.18.0
Minor Changes
- #2782
04065b9Thanks @haacked! - Add $feature_flag_error to $feature_flag_called events when an error occurred while trying evaluate a flag (2025-12-22)
Patch Changes
- Updated dependencies [
b676b4d]:- @hanzo/[email protected]
5.17.4
Patch Changes
- Updated dependencies [
6b0aabf]:- @hanzo/[email protected]
5.17.3
Patch Changes
- Updated dependencies [
2603a8d]:- @hanzo/[email protected]
5.17.2
Patch Changes
- #2678
ca4436eThanks @haacked! - Local evaluation polling sends If-None-Match header with latest etag to reduce bandwidth when no flags have changed. (2025-12-04)
5.17.1
Patch Changes
-
#2690
e9c00fdThanks @robbie-c! - Related to https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182We didn't include any of the vulnerable deps in any of our packages, however we did have them as dev / test / example project dependencies.
There was no way that any of these vulnerable packages were included in any of our published packages.
We've now patched out those dependencies.
Out of an abundance of caution, let's create a new release of all of our packages. (2025-12-04)
-
Updated dependencies [
e9c00fd]:- @hanzo/[email protected]
5.17.0
Minor Changes
- #2671
a1dde5cThanks @ablaszkiewicz! - make contexts inherit by default (2025-12-03)
5.16.0
Minor Changes
- #2603
e1617d9Thanks @dmarticus! - add $feature_flag_evaluated_at properties to $feature_flag_called events (2025-12-03)
Patch Changes
- Updated dependencies [
e1617d9]:- @hanzo/[email protected]
5.15.0
Minor Changes
-
#2614
2be0eb3Thanks @dustinbyrne! - fix: Improve cache initialization performance (2025-12-01) -
#2588
ef589b6Thanks @ablaszkiewicz! - add context support (2025-12-01)
5.14.1
Patch Changes
- #2636
922afafThanks @hpouillot! - forward session and distinct id in express error handler (2025-11-28)
5.14.0
Minor Changes
- #2619
86dab38Thanks @hpouillot! - package deprecation (2025-11-24)
Patch Changes
- Updated dependencies [
86dab38]:- @hanzo/[email protected]
5.13.3
Patch Changes
- #2618
3eed1a4Thanks @marandaneto! - last version was compromised (2025-11-24) - Updated dependencies [
3eed1a4]:- @hanzo/[email protected]
5.13.2
Patch Changes
- Updated dependencies [
83f5d07]:- @hanzo/[email protected]
5.13.1
Patch Changes
- Updated dependencies [
c242702]:- @hanzo/[email protected]
5.13.0
Minor Changes
-
#2600
8972000Thanks @dustinbyrne! - fix:fetchis called without a bound contextThis prevents issues in edge runtimes such as Cloudflare (2025-11-19)
Patch Changes
- #2575
8acd88fThanks @hpouillot! - fix frame platform property for $exception events (2025-11-19) - Updated dependencies [
8acd88f]:- @hanzo/[email protected]
5.12.0
Minor Changes
- #2594
4ad3678Thanks @dustinbyrne! - feat: AddFlagDefinitionCacheProviderinterface and client configuration option
5.11.2
Patch Changes
- Updated dependencies [
87f9604]:- @hanzo/[email protected]
5.11.1
Patch Changes
- Updated dependencies [
d8d98c9]:- @hanzo/[email protected]
5.11.0
Minor Changes
- #2520
068d55eThanks @lricoy! - Add bot pageview collection behind preview flag. Enables tracking bot traffic as$bot_pageviewevents when the__preview_capture_bot_pageviewsflag is enabled.
Patch Changes
- Updated dependencies [
068d55e]:- @hanzo/[email protected]
5.10.4
Patch Changes
- Updated dependencies [
751b440]:- @hanzo/[email protected]
5.10.3
Patch Changes
- Updated dependencies [
e0a6fe0]:- @hanzo/[email protected]
5.10.2
Patch Changes
- #2470
a581328Thanks @luke-belton! - Fix crash caused by callinggetFeatureFlagPayloadsfor a flag that depends on a static cohort
5.10.1
Patch Changes
- #2465
1721abaThanks @haacked! - Fix bug where flag doesn't fallback to the server correctly when one condition is a static cohort condition but a later condition matches.
5.10.0
Minor Changes
-
#2417
daf919bThanks @dmarticus! - feat: Add evaluation environments support for feature flagsThis PR implements support for evaluation environments in the @hanzo/insights-node SDK, allowing users to specify which environment tags their SDK instance should use when evaluating feature flags.
Users can now configure the SDK with an
evaluationEnvironmentsoption:const client = new Insights('api-key', { host: 'https://app.insights.hanzo.ai', evaluationEnvironments: ['production', 'backend', 'api'], })When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.
Patch Changes
-
#2431
7d45a7aThanks @marandaneto! - fix: remove deprecated attribute $exception_personURL from exception events -
Updated dependencies [
daf919b,7d45a7a]:- @hanzo/[email protected]
5.9.5
Patch Changes
- Updated dependencies [
10da2ee]:- @hanzo/[email protected]
5.9.4
Patch Changes
-
#2414
e19a384Thanks @hpouillot! - create a common logger for node and react-native -
Updated dependencies [
e19a384]:- @hanzo/[email protected]
5.9.3
Patch Changes
- #2406
ea58d34Thanks @dmarticus! - UseSubtleCryptodirectly to compute SHA-1 hashes, fix "module not found" warning in edge runtimes.
5.9.2
Patch Changes
-
#2370
5820942Thanks @hpouillot! - remove testing from insights-core -
Updated dependencies [
5820942]:- @hanzo/[email protected]
5.9.1
Patch Changes
-
#2356
caecb94Thanks @hpouillot! - use core error tracking processing -
Updated dependencies [
caecb94]:- @hanzo/[email protected]
5.9.0
Minor Changes
- #2348
ac48d8fThanks @hpouillot! - chore: align js syntax with package support
Patch Changes
- Updated dependencies [
ac48d8f]:- @hanzo/[email protected]
5.8.8
Patch Changes
- #2350
a1ae750Thanks @andyzzhao! - feature flag local evaluation will not sort condition sets with variant overrides to the top
5.8.7
Patch Changes
- fix: don't sort condition sets with variant overrides to the top - conditions are now evaluated in their original order to match server-side logic
5.8.6
Patch Changes
- #2346
117b150Thanks @marandaneto! - fix: node onException autocapture safely access the exception_List
5.8.5
Patch Changes
- Updated dependencies [
da07e41]:- @hanzo/[email protected]
5.8.4
Patch Changes
- #2312
dff84c6Thanks @daibhin! - chore: allow Insights exception capture to be skipped in Sentry integration
5.8.3
Patch Changes
- #2306
30873bcThanks @haacked! - Fix memory leak when calling getAllFlags and getAllFlagsAndPayloads
5.8.2
Patch Changes
-
#2285
20c1b38Thanks @dustinbyrne! -getFeatureFlagandisFeatureEnablednow respect thesendFeatureFlagEventclient option if not explicitly specified when called. -
#2285
20c1b38Thanks @dustinbyrne! - ThesendFeatureFlagEventsoption forgetFeatureFlagPayloadis now marked as deprecated as it is not used.
5.8.1
Patch Changes
- #2243
1981815Thanks @hpouillot! - - fix error handling on process crash- fix exception flushing
- Updated dependencies [
1981815]:- @hanzo/[email protected]
5.8.0
Minor Changes
Patch Changes
- Updated dependencies [
44d10c4]:- @hanzo/[email protected]
5.7.0
Minor Changes
- #2218
cfe1e94Thanks @oliverb123! - Added before_send function
5.6.0 – 2025-07-15
- Added support for filtering feature flags with flagKeys parameter in sendFeatureFlags options
5.5.1 – 2025-07-15
- wrap
InconclusiveMatchErrors inlogMsgIfDebugfor local flag evaluations onsendFeatureFlags
5.5.0 – 2025-07-10
- feat: make the
sendFeatureFlagsparameter more declarative and ergonomic. Implementation notes below:
Modified sendFeatureFlags to be type boolean | SendFeatureFlagsOptions, (which is defined thusly)
export interface SendFeatureFlagsOptions {
onlyEvaluateLocally?: boolean
personProperties?: Record<string, any>
groupProperties?: Record<string, Record<string, any>>
}
This lets users declare (1) whether to use local evaluation, and (2) which properties to supply explicitly for that evaluation, every time they want to send feature flags. It also supports the old boolean behavior if folks don't care and would rather the SDK infer it.
Now, you can make calls like this
insights.captureImmediate({
distinctId: 'user123',
event: 'test event',
sendFeatureFlags: {
onlyEvaluateLocally: true,
personProperties: {
plan: 'premium',
},
},
properties: {
foo: 'bar',
},
})
or simply
insights.captureImmediate({
distinctId: "user123",
event: "test event",
sendFeatureFlags: true // this will still infer local evaluation if it appears to be configured, but it won't try to pull properties from the event message
properties: {
foo: "bar",
},
});
5.4.0 – 2025-07-09
feat: respect local evaluation preferences with sendFeatureFlags; add property overrides from the event to those local computations so that the locally evaluated flags can be more accuratee. NB: this change chagnes the default behavior of capture and captureImmediately – we will now only send feature flag data along with those events if sendFeatureFlags is explicitly specified, instead of optimistically sending along locally evaluated flags by default.
5.3.1 - 2025-07-07
- feat: decouple feature flag local evaluation from personal API keys; support decrypting remote config payloads without relying on the feature flags poller
5.2.1 - 2025-07-07
- feat: add captureExceptionImmediate method on insights client
5.1.1 - 2025-06-16
- fix: Handle double-encoded JSON payloads from the remote config endpoint
5.1.0 - 2025-06-12
- chore: use
/flags?v=2&config=trueinstead of/decide?v=4for the flag evaluation backend
5.0.0 - 2025-06-10
Removed
- Remove
is_simple_flagfromInsightsFeatureFlagtype - Remove
captureModein favor ofjsoncapture mode only - Remove deprecated
personPropertiesandgroupPropertiesin favor ofsetPersonPropertiesForFlagsandsetGroupPropertiesForFlags
Breaking changes
- feat: migrate to native fetch, Node 20+ required
- Insights Node now compresses messages with GZip before sending them to our servers when the runtime supports compression. This reduces network bandwidth and improves performance. Network traffic interceptors and test assertions on payloads must handle GZip decompression to inspect the data. Alternatively, you can disable compression by setting
disableCompression: truein the client configuration during tests.
5.0.0-alpha.1 - 2025-04-29
Breaking changes
- feat: migrate to native fetch, Node 18+ required
Added
- rotate session id if expired after 24 hours
4.17.2 - 2025-05-22
- chore: improve event prop types
- fix: no throw in sendImmediate
4.17.1 - 2025-05-02
- fix: fix imports for old node.js version
4.17.0 - 2025-05-02
- fix: specific exports for edge environments
4.16.0 - 2025-05-01
- chore: improve flush event
4.15.0 - 2025-04-30
- chore: add immediate-mode
- chore: better error logging when flushing events
4.14.0 - 2025-04-24
- feat: Add super properties as a concept to the Node SDK
4.13.0 - 2025-04-21
- feat: Add method to wait for local evaluation feature flag definitions to be loaded
4.12.0 – 2025-04-17
- chore: roll out new feature flag evaluation backend to majority of customers
4.11.7 - 2025-04-16
- fix: do not reference
node:prefix as it is not supported by Next.js edge runtime
4.11.6 - 2025-04-15
Fixed
- move survey export top-level declarations
4.11.5 - 2025-04-14
Fixed
- export and declare top-level declarations for surveys
4.11.4 - 2025-04-14
Fixed
- export top-level declarations for surveys
4.11.3 - 2025-04-08
Fixed
- do not access
fsorreadlinein when not available e.g. edge environments
4.11.2 - 2025-04-07
Fixed
- chore: bump axios to 1.8.2 (fixes CVE-2025-27152)
4.11.1 - 2025-03-28
Fixed
getFeatureFlag,isFeatureEnabled, andgetAllFlagsAndPayloadsnow returnundefinedif the flag is not found.
4.11.0 - 2025-03-28
Added
$feature_flag_calledevent now includes additional properties such asfeature_flag_id,feature_flag_version,feature_flag_reason, andfeature_flag_request_id.
Fixed
- apiKey cannot be empty.
4.10.2 - 2025-03-06
- Add: log error message when feature flags have computation errors.
4.10.1 – 2025-03-06
- Fix: only set
platformon Insights exception frame properties - Fix: prevent fetch floods when rate-limited.
4.10.0 – 2025-03-06
- Attach requestId to $feature_flag_called if present in /decide response
4.9.0 – 2025-03-04
- Allow feature flags to be evaluated individually when local evaluation is not being used
4.8.1 – 2025-02-26
- Supports gracefully handling quotaLimited responses from the Insights API for feature flag evaluation
4.8.0 - 2025-02-26
- Add guardrails and exponential error backoff in the feature flag local evaluation poller to prevent high rates of 401/403 traffic towards
/local_evaluation
4.7.0 - 2025-02-20
Added
- Adds the ability to capture user feedback in LLM Observability using the
captureTraceFeedbackandcaptureTraceMetricmethods.
4.6.0 - 2025-02-12
Added
- Adds ability to fetch decrypted remote config flag payloads via
getRemoteConfigPayload
4.5.2 - 2025-02-12
Fixed
- fix: Fixed edge case where
$feature_flag_calledevents were enriched with additional feature flag data when they shouldn't be.
4.5.1 - 2025-02-12
Fixed
- Do not require a
distinctIdas an argument tocaptureException
4.5.0 - 2025-02-06
Added
- Adds manual exception capture with full stack trace processing via
captureExceptionfunction - Adds ability to enable exception autocapture via the
enableExceptionAutocaptureinit option
4.4.1 - 2025-01-21
- Add option privacyMode to remove input and output from LLM Observability
4.4.0 - 2025-01-15
Switch from rusha to native (node:crypto) sha1 implementation
4.3.2 - 2024-12-11
- REVERT: Fix bug where this SDK incorrectly sent
$feature_flag_calledevents with null values when usinggetFeatureFlagPayload.
4.3.1 - 2024-11-26
- Fix bug where this SDK incorrectly sent
$feature_flag_calledevents with null values when usinggetFeatureFlagPayload.
4.3.0 - 2024-11-25
- Add Sentry v8 support to the Sentry integration
4.2.3 - 2024-11-21
- fix: identify method allows passing a $set_once object
4.2.2 - 2024-11-18
- fix: Shutdown will now respect the timeout and forcefully return rather than returning after the next fetch.
4.2.1 - 2024-10-14
- fix: only log messages if debug is enabled
4.2.0 - 2024-08-26
- Added
historicalMigrationoption for use in tools that are migrating large data to Insights
4.1.1 - 2024-08-20
- Local evaluation returns correct results on
undefined/nullvalues
4.1.0 - 2024-08-14
- chore: change host to new address.
- chore: bump axios to 1.7.4 (fixes CVE-2024-39338)
4.0.1 - 2024-04-25
- Prevent double JSON parsing of feature flag payloads, which would convert the payload [1] into 1.
4.0.0 - 2024-03-18
Added
- Adds a
disabledoption and the ability to change it later viainsights.disabled = true. Useful for disabling Insights tracking for example in a testing environment without having complex conditional checking - Adds a new
featureFlagsRequestTimeoutMstimeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls. shutdowntakes ashutdownTimeoutMsparam with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.- Flushes will now try to flush up to
maxBatchSize(default 100) in one go - Queued events are limited up to
maxQueueSize(default 1000) and the oldest events are dropped when the limit is reached - Sets
User-Agentheaders with SDK name and version for RN
Removed
flushAsyncandshutdownAsyncare removed withflushandshutdownnow being the async methods.
Changed
flushandshutdownnow being async methods.
Fixed
- Fixed an issue where
shutdownwould potentially exit early if a flush was already in progress - Fixes some typos in types
4.0.0-beta.3 - 2024-03-13
- Sets
User-Agentheaders with SDK name and version for RN
4.0.0-beta.2 - 2024-03-12
flushAsyncandshutdownAsyncare removed withflushandshutdownnow being the async methods.- Fixed an issue where
shutdownwould potentially exit early if a flush was already in progress - Flushes will now try to flush up to
maxBatchSize(default 100) in one go
4.0.0-beta.1 - 2024-03-04
- Adds a
disabledoption and the ability to change it later viainsights.disabled = true. Useful for disabling Insights tracking for example in a testing environment without having complex conditional checking - Fixes some typos in types
shutdownandshutdownAsynctakes ashutdownTimeoutMsparam with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.- Adds a new
featureFlagsRequestTimeoutMstimeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls.
3.6.3 - 2024-02-15
- fix: using
captureMode=formwon't throw an error and retry unnecessarily
3.6.2 - 2024-02-06
- Swapped to
uuidv7for unique ID generation
3.6.1 - 2024-01-26
- Remove new relative date operators, combine into regular date operators
3.6.0 - 2024-01-18
- Adds support for overriding the event
uuid
3.5.0 - 2024-01-09
- When local evaluation is enabled, we automatically add flag information to all events sent to Insights, whenever possible. This makes it easier to use these events in experiments.
- Fixes a bug where in some rare cases we may drop events when send_feature_flags is enabled on capture.
3.4.0 - 2024-01-09
- Numeric property handling for feature flags now does the expected: When passed in a number, we do a numeric comparison. When passed in a string, we do a string comparison. Previously, we always did a string comparison.
- Add support for relative date operators for local evaluation.
3.3.0 - 2024-01-02
- Adds InsightsSentryIntegration to allow automatic capturing of exceptions reported via the @sentry/node package
3.2.1 - 2023-12-15
- Fixes issue where a background refresh of feature flags could throw an unhandled error. It now emits to be detected by
.on('error', ...)
3.2.0 - 2023-12-05
- Fixes issues with Axios imports for non-node environments like Cloudflare workers
- Uses the globally defined
fetchif available, otherwise imports and uses axios as a polyfill
3.1.3 - 2023-10-27
- Updates axios dependency
3.1.2 - 2023-08-17
- Returns the current flag property with $feature_flag_called events, to make it easier to use in experiments
3.1.1 - 2023-04-26
- Replace crypto library with pure-js rusha library which makes @hanzo/insights-node work with Cloudflare Workers in Next.js edge runtime.
3.1.0 - 2023-04-19
- Some small fixes to incorrect types
- Fixed fetch compatibility by aligning error handling
- Added two errors: InsightsFetchHttpError (non-2xx status) and InsightsFetchNetworkError (fetch network error)
- Added .on('error', (err) => void)
- shutdownAsync now ignores fetch errors. They should be handled with .on('error', ...) from now on.
3.0.0 - 2023-04-14
Breaking change:
All events by default now send the $geoip_disable property to disable geoip lookup in app. This is because usually we don't
want to update person properties to take the server's location.
The same now happens for feature flag requests, where we discard the IP address of the server for matching on geoip properties like city, country, continent.
To restore previous behaviour, you can set the default to False like so:
const insights = new Insights(PH_API_KEY, {
host: PH_HOST,
disableGeoip: false,
})
2.6.0 - 2023-03-14
- Add support for all cohorts local evaluation in feature flags.
2.5.4 - 2023-02-27
- Fix error log for local evaluation of feature flags (InconclusiveMatchError(s)) to only show during debug mode.
2.5.3 - 2023-02-21
- Allow passing in a distinctId to
groupIdentify(). - Fix a bug with active feature flags on capture events, where non-active flags would be added to the list as well.
2.5.2 - 2023-02-17
- Fix issue where properties passed to
.identifywere not set correctly
2.5.1 - 2023-02-16
- Make sure shutdown waits for pending promises to resolve. Fixes a problem with using Insights Node in serverless environments.
2.5.0 - 2023-02-15
- Removes shared client from
@hanzo/insights-node, getting rid of some race condition bugs when capturing events. - Sets minimum version of node.js to 15
2.4.0 - 2023-02-02
- Adds support for overriding timestamp of capture events
2.3.0 - 2023-1-26
- uses v3 decide endpoint
- JSON payloads will be returned with feature flags
- Feature flags will gracefully fail and optimistically save evaluated flags if server is down
2.2.3 - 2022-12-01
- Fix issues with timeouts for local evaluation requests
2.2.2 - 2022-11-28
- Fix issues with timeout
2.2.1 - 2022-11-24
- Add standard 10 second timeout
2.2.0 - 2022-11-18
- Add support for variant overrides for feature flag local evaluation.
- Add support for date operators in feature flag local evaluation.
2.1.0 - 2022-09-08
- Swaps
unidiciforaxiosin order to support older versions of Node - The
fetchimplementation can be overridden as an option for those who wish to use an alternative implementation - Fixes the minimum Node version to >=14.17.0
2.0.2 - 2022-08-23
- Removes references to
cli.js - Removes default
InsightsGlobalexport, and unifies import signature fortypescript,commonjsandesmbuilds.
2.0.1 - 2022-08-15
Breaking changes:
- Feature flag defaults are no more. When we fail to compute any flag, we return
undefined. All computed flags return eithertrue,falseorString. - Minimum Insights version requirement is 1.38
- Default polling interval for feature flags is now set at 30 seconds. If you don't want local evaluation, don't set a personal API key in the library.
- The
callbackparameter passed as an optional last argument to most of the methods is no longer supported - The CLI is no longer supported
What's new:
- You can now evaluate feature flags locally (i.e. without sending a request to your Insights servers) by setting a personal API key, and passing in groups and person properties to
isFeatureEnabledandgetFeatureFlagcalls. - Introduces a
getAllFlagsmethod that returns all feature flags. This is useful for when you want to seed your frontend with some initial flags, given a user ID.