posthog-node 4.2.2 → 4.2.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 +4 -0
- package/lib/index.cjs.js +9 -4
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.esm.js +9 -4
- package/lib/index.esm.js.map +1 -1
- package/lib/posthog-core/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/posthog-node.ts +9 -2
- package/test/posthog-node.spec.ts +29 -3
package/CHANGELOG.md
CHANGED
package/lib/index.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var rusha = require('rusha');
|
|
6
6
|
|
|
7
|
-
var version = "4.2.
|
|
7
|
+
var version = "4.2.3";
|
|
8
8
|
|
|
9
9
|
var PostHogPersistedProperty;
|
|
10
10
|
(function (PostHogPersistedProperty) {
|
|
@@ -1064,7 +1064,7 @@ class PostHogCoreStateless {
|
|
|
1064
1064
|
identifyStateless(distinctId, properties, options) {
|
|
1065
1065
|
this.wrap(() => {
|
|
1066
1066
|
// The properties passed to identifyStateless are event properties.
|
|
1067
|
-
// To add person properties, pass in all person properties to the `$set`
|
|
1067
|
+
// To add person properties, pass in all person properties to the `$set` and `$set_once` keys.
|
|
1068
1068
|
const payload = {
|
|
1069
1069
|
...this.buildPayload({
|
|
1070
1070
|
distinct_id: distinctId,
|
|
@@ -2163,9 +2163,14 @@ class PostHog extends PostHogCoreStateless {
|
|
|
2163
2163
|
disableGeoip
|
|
2164
2164
|
}) {
|
|
2165
2165
|
// Catch properties passed as $set and move them to the top level
|
|
2166
|
-
|
|
2166
|
+
// promote $set and $set_once to top level
|
|
2167
|
+
const userPropsOnce = properties?.$set_once;
|
|
2168
|
+
delete properties?.$set_once;
|
|
2169
|
+
// if no $set is provided we assume all properties are $set
|
|
2170
|
+
const userProps = properties?.$set || properties;
|
|
2167
2171
|
super.identifyStateless(distinctId, {
|
|
2168
|
-
$set:
|
|
2172
|
+
$set: userProps,
|
|
2173
|
+
$set_once: userPropsOnce
|
|
2169
2174
|
}, {
|
|
2170
2175
|
disableGeoip
|
|
2171
2176
|
});
|