posthog-node 6.3.0 → 6.4.0

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/src/types.ts CHANGED
@@ -70,6 +70,22 @@ export type SendFeatureFlagsOptions = {
70
70
  personProperties?: Properties
71
71
  /** Group properties keyed by group type for evaluating group-targeted flags. */
72
72
  groupProperties?: Record<string, Properties>
73
+ /**
74
+ * Person property keys you know this person doesn't have. Local evaluation treats a listed key as
75
+ * absent even when `personProperties` has a value for it, so `is_not_set` and the negated
76
+ * operators match and every other supported operator doesn't, without a `/flags` request. A filter
77
+ * with an operator the SDK can't evaluate locally, or with an operator that needs a value but has
78
+ * none, still falls back to `/flags`.
79
+ * The list is sent to `/flags` when evaluation falls back to it. At most 1000 keys, counting
80
+ * duplicates; with a longer list no flags are evaluated and the event is sent without flag properties.
81
+ */
82
+ personPropertyKeysKnownAbsent?: string[]
83
+ /**
84
+ * Group property keys you know each group doesn't have, by group type name. A key applies only to
85
+ * its own group type. Otherwise follows `personPropertyKeysKnownAbsent`, with the 1000-key limit
86
+ * applying to each group type's list.
87
+ */
88
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>
73
89
  /** Restrict evaluation to these flag keys. */
74
90
  flagKeys?: string[]
75
91
  }
@@ -213,6 +229,22 @@ export type BaseFlagEvaluationOptions = {
213
229
  personProperties?: Properties
214
230
  /** Group properties keyed by group type for evaluating group-targeted flags. */
215
231
  groupProperties?: Record<string, Properties>
232
+ /**
233
+ * Person property keys you know this person doesn't have. Local evaluation treats a listed key as
234
+ * absent even when `personProperties` has a value for it, so `is_not_set` and the negated
235
+ * operators match and every other supported operator doesn't, without a `/flags` request. A filter
236
+ * with an operator the SDK can't evaluate locally, or with an operator that needs a value but has
237
+ * none, still falls back to `/flags`.
238
+ * The list is sent to `/flags` when evaluation falls back to it. At most 1000 keys, counting
239
+ * duplicates; a longer list throws an error and no flags are evaluated.
240
+ */
241
+ personPropertyKeysKnownAbsent?: string[]
242
+ /**
243
+ * Group property keys you know each group doesn't have, by group type name. A key applies only to
244
+ * its own group type. Otherwise follows `personPropertyKeysKnownAbsent`, with the 1000-key limit
245
+ * applying to each group type's list.
246
+ */
247
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>
216
248
  /** Skip remote fallback and omit flags that local definitions cannot resolve. */
217
249
  onlyEvaluateLocally?: boolean
218
250
  /** Overrides the client's `disableGeoip` setting for this evaluation call. */
@@ -950,6 +982,8 @@ export interface IPostHog {
950
982
  * @param groups optional - what groups are currently active (group analytics). Required if the flag depends on groups.
951
983
  * @param personProperties optional - what person properties are known. Used to compute flags locally when definitions are available.
952
984
  * @param groupProperties optional - what group properties are known. Used to compute flags locally when definitions are available.
985
+ * @param personPropertyKeysKnownAbsent optional - person property keys known to be absent. See {@link BaseFlagEvaluationOptions}.
986
+ * @param groupPropertyKeysKnownAbsent optional - group property keys known to be absent, by group type. See {@link BaseFlagEvaluationOptions}.
953
987
  * @param onlyEvaluateLocally optional - whether to only evaluate the flag locally. Defaults to false.
954
988
  * @param sendFeatureFlagEvents optional - whether to send feature flag events. Used for Experiments. Defaults to true.
955
989
  *
@@ -965,6 +999,8 @@ export interface IPostHog {
965
999
  groups?: Record<string, string>
966
1000
  personProperties?: Properties
967
1001
  groupProperties?: Record<string, Properties>
1002
+ personPropertyKeysKnownAbsent?: string[]
1003
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>
968
1004
  onlyEvaluateLocally?: boolean
969
1005
  sendFeatureFlagEvents?: boolean
970
1006
  }
@@ -981,6 +1017,8 @@ export interface IPostHog {
981
1017
  * @param groups optional - what groups are currently active (group analytics). Required if the flag depends on groups.
982
1018
  * @param personProperties optional - what person properties are known. Used to compute flags locally when definitions are available.
983
1019
  * @param groupProperties optional - what group properties are known. Used to compute flags locally when definitions are available.
1020
+ * @param personPropertyKeysKnownAbsent optional - person property keys known to be absent. See {@link BaseFlagEvaluationOptions}.
1021
+ * @param groupPropertyKeysKnownAbsent optional - group property keys known to be absent, by group type. See {@link BaseFlagEvaluationOptions}.
984
1022
  * @param onlyEvaluateLocally optional - whether to only evaluate the flag locally. Defaults to false.
985
1023
  * @param sendFeatureFlagEvents optional - whether to send feature flag events. Used for Experiments. Defaults to true.
986
1024
  *
@@ -996,6 +1034,8 @@ export interface IPostHog {
996
1034
  groups?: Record<string, string>
997
1035
  personProperties?: Properties
998
1036
  groupProperties?: Record<string, Properties>
1037
+ personPropertyKeysKnownAbsent?: string[]
1038
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>
999
1039
  onlyEvaluateLocally?: boolean
1000
1040
  sendFeatureFlagEvents?: boolean
1001
1041
  }
@@ -1023,6 +1063,8 @@ export interface IPostHog {
1023
1063
  * @param matchValue The flag value previously obtained from calling `getFeatureFlag()`. Can be a string or boolean.
1024
1064
  * To avoid extra network calls, pass this parameter when you can.
1025
1065
  * @param options: dict with optional parameters below
1066
+ * @param personPropertyKeysKnownAbsent optional - person property keys known to be absent. See {@link BaseFlagEvaluationOptions}.
1067
+ * @param groupPropertyKeysKnownAbsent optional - group property keys known to be absent, by group type. See {@link BaseFlagEvaluationOptions}.
1026
1068
  * @param onlyEvaluateLocally optional - whether to only evaluate the flag locally. Defaults to false.
1027
1069
  *
1028
1070
  * @returns payload of a json type object
@@ -1035,6 +1077,8 @@ export interface IPostHog {
1035
1077
  distinctId: string,
1036
1078
  matchValue?: FeatureFlagValue,
1037
1079
  options?: {
1080
+ personPropertyKeysKnownAbsent?: string[]
1081
+ groupPropertyKeysKnownAbsent?: Record<string, string[]>
1038
1082
  onlyEvaluateLocally?: boolean
1039
1083
  }
1040
1084
  ): Promise<JsonType | undefined>
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "6.3.0"
1
+ export const version = "6.4.0"