posthog-node 5.28.4 → 5.28.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/error-tracking/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAIlE,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,4BAA4B,CAAS;IAC7C,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,OAAO,CAAQ;IAEvB,MAAM,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,sBAAsB,CAAA;gBAE3D,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM;IAkBlF,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO;WAIxC,iBAAiB,CAC5B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,iBAAiB,CAAC,SAAS,EACjC,UAAU,CAAC,EAAE,MAAM,EACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,GAClD,OAAO,CAAC,YAAY,CAAC;IAyBxB,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,WAAW;YAoBL,YAAY;IAM1B,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,IAAI;CAGjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/error-tracking/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAIlE,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,4BAA4B,CAAS;IAC7C,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,OAAO,CAAQ;IAEvB,MAAM,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,sBAAsB,CAAA;gBAE3D,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM;IAkBlF,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO;WAIxC,iBAAiB,CAC5B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,iBAAiB,CAAC,SAAS,EACjC,UAAU,CAAC,EAAE,MAAM,EACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,GAClD,OAAO,CAAC,YAAY,CAAC;IAqBxB,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,WAAW;YAoBL,YAAY;IAM1B,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,IAAI;CAGjB"}
@@ -49,12 +49,11 @@ class ErrorTracking {
49
49
  const properties = {
50
50
  ...additionalProperties
51
51
  };
52
- if (!distinctId) properties.$process_person_profile = false;
53
52
  const exceptionProperties = this.errorPropertiesBuilder.buildFromUnknown(error, hint);
54
53
  exceptionProperties.$exception_list = await this.errorPropertiesBuilder.modifyFrames(exceptionProperties.$exception_list);
55
54
  return {
56
55
  event: '$exception',
57
- distinctId: distinctId || (0, core_namespaceObject.uuidv7)(),
56
+ distinctId: distinctId,
58
57
  properties: {
59
58
  ...exceptionProperties,
60
59
  ...properties
@@ -1,5 +1,5 @@
1
1
  import { addUncaughtExceptionListener, addUnhandledRejectionListener } from "./autocapture.mjs";
2
- import { BucketedRateLimiter, isObject, uuidv7 } from "@posthog/core";
2
+ import { BucketedRateLimiter, isObject } from "@posthog/core";
3
3
  const SHUTDOWN_TIMEOUT = 2000;
4
4
  class ErrorTracking {
5
5
  constructor(client, options, _logger){
@@ -21,12 +21,11 @@ class ErrorTracking {
21
21
  const properties = {
22
22
  ...additionalProperties
23
23
  };
24
- if (!distinctId) properties.$process_person_profile = false;
25
24
  const exceptionProperties = this.errorPropertiesBuilder.buildFromUnknown(error, hint);
26
25
  exceptionProperties.$exception_list = await this.errorPropertiesBuilder.modifyFrames(exceptionProperties.$exception_list);
27
26
  return {
28
27
  event: '$exception',
29
- distinctId: distinctId || uuidv7(),
28
+ distinctId: distinctId,
30
29
  properties: {
31
30
  ...exceptionProperties,
32
31
  ...properties
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "5.28.4";
1
+ export declare const version = "5.28.6";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -26,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  version: ()=>version
28
28
  });
29
- const version = '5.28.4';
29
+ const version = '5.28.6';
30
30
  exports.version = __webpack_exports__.version;
31
31
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
32
32
  "version"
package/dist/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- const version = '5.28.4';
1
+ const version = '5.28.6';
2
2
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-node",
3
- "version": "5.28.4",
3
+ "version": "5.28.6",
4
4
  "description": "PostHog Node.js integration",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,7 +25,7 @@
25
25
  "module": "dist/entrypoints/index.node.mjs",
26
26
  "types": "dist/entrypoints/index.node.d.ts",
27
27
  "dependencies": {
28
- "@posthog/core": "1.24.0"
28
+ "@posthog/core": "1.24.1"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@edge-runtime/jest-environment": "^4.0.0",
@@ -1,6 +1,6 @@
1
1
  import { addUncaughtExceptionListener, addUnhandledRejectionListener } from './autocapture'
2
2
  import { PostHogBackendClient } from '@/client'
3
- import { isObject, uuidv7 } from '@posthog/core'
3
+ import { isObject } from '@posthog/core'
4
4
  import { EventMessage, PostHogOptions } from '@/types'
5
5
  import type { Logger } from '@posthog/core'
6
6
  import { BucketedRateLimiter } from '@posthog/core'
@@ -46,12 +46,6 @@ export default class ErrorTracking {
46
46
  ): Promise<EventMessage> {
47
47
  const properties: EventMessage['properties'] = { ...additionalProperties }
48
48
 
49
- // Given stateless nature of Node SDK we capture exceptions using personless processing when no
50
- // user can be determined because a distinct_id is not provided e.g. exception autocapture
51
- if (!distinctId) {
52
- properties.$process_person_profile = false
53
- }
54
-
55
49
  const exceptionProperties = this.errorPropertiesBuilder.buildFromUnknown(error, hint)
56
50
  exceptionProperties.$exception_list = await this.errorPropertiesBuilder.modifyFrames(
57
51
  exceptionProperties.$exception_list
@@ -59,7 +53,9 @@ export default class ErrorTracking {
59
53
 
60
54
  return {
61
55
  event: '$exception',
62
- distinctId: distinctId || uuidv7(),
56
+ // Leave distinctId resolution to prepareEventMessage which checks request context
57
+ // and falls back to a random UUID with $process_person_profile = false
58
+ distinctId: distinctId,
63
59
  properties: {
64
60
  ...exceptionProperties,
65
61
  ...properties,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '5.28.4'
1
+ export const version = '5.28.6'