posthog-node 2.5.2 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.5.3 - 2023-02-21
2
+
3
+ 1. Allow passing in a distinctId to `groupIdentify()`.
4
+ 2. Fix a bug with active feature flags on capture events, where non-active flags would be added to the list as well.
1
5
  # 2.5.2 - 2023-02-17
2
6
 
3
7
  1. Fix issue where properties passed to `.identify` were not set correctly
package/lib/index.cjs.js CHANGED
@@ -163,7 +163,7 @@ function __spreadArray(to, from, pack) {
163
163
  return to.concat(ar || Array.prototype.slice.call(from));
164
164
  }
165
165
 
166
- var version = "2.5.2";
166
+ var version = "2.5.3";
167
167
 
168
168
  var PostHogPersistedProperty;
169
169
  (function (PostHogPersistedProperty) {
@@ -2355,12 +2355,19 @@ function (_super) {
2355
2355
  var _b = _a[_i],
2356
2356
  feature = _b[0],
2357
2357
  variant = _b[1];
2358
- featureVariantProperties["$feature/".concat(feature)] = variant;
2358
+
2359
+ if (variant !== false) {
2360
+ featureVariantProperties["$feature/".concat(feature)] = variant;
2361
+ }
2359
2362
  }
2360
2363
  }
2361
2364
 
2365
+ var activeFlags = Object.keys(flags || {}).filter(function (flag) {
2366
+ return (flags === null || flags === void 0 ? void 0 : flags[flag]) !== false;
2367
+ });
2368
+
2362
2369
  var flagProperties = __assign({
2363
- $active_feature_flags: flags ? Object.keys(flags) : undefined
2370
+ $active_feature_flags: activeFlags || undefined
2364
2371
  }, featureVariantProperties);
2365
2372
 
2366
2373
  _capture(__assign(__assign(__assign({}, properties), {
@@ -2647,9 +2654,10 @@ function (_super) {
2647
2654
  PostHog.prototype.groupIdentify = function (_a) {
2648
2655
  var groupType = _a.groupType,
2649
2656
  groupKey = _a.groupKey,
2650
- properties = _a.properties;
2657
+ properties = _a.properties,
2658
+ distinctId = _a.distinctId;
2651
2659
 
2652
- _super.prototype.groupIdentifyStateless.call(this, groupType, groupKey, properties);
2660
+ _super.prototype.groupIdentifyStateless.call(this, groupType, groupKey, properties, undefined, distinctId);
2653
2661
  };
2654
2662
 
2655
2663
  PostHog.prototype.reloadFeatureFlags = function () {