posthog-node 4.10.0 → 4.10.1

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,5 +1,9 @@
1
1
  # Next
2
2
 
3
+ # 4.10.1 – 2025-03-06
4
+
5
+ 1. Fix: only set `platform` on PostHog exception frame properties
6
+
3
7
  # 4.10.0 – 2025-03-06
4
8
 
5
9
  1. Attach requestId to $feature_flag_called if present in /decide response
package/lib/index.cjs.js CHANGED
@@ -7,7 +7,7 @@ var node_fs = require('node:fs');
7
7
  var node_readline = require('node:readline');
8
8
  var node_path = require('node:path');
9
9
 
10
- var version = "4.10.0";
10
+ var version = "4.10.1";
11
11
 
12
12
  var PostHogPersistedProperty;
13
13
  (function (PostHogPersistedProperty) {
@@ -3397,18 +3397,26 @@ function createEventProcessor(_posthog, {
3397
3397
  const personUrl = new URL(`/project/${_posthog.apiKey}/person/${userId}`, uiHost).toString();
3398
3398
  event.tags['PostHog Person URL'] = personUrl;
3399
3399
  const exceptions = event.exception?.values || [];
3400
- exceptions.map(exception => {
3401
- if (exception.stacktrace) {
3402
- exception.stacktrace.type = 'raw';
3403
- }
3404
- });
3400
+ const exceptionList = exceptions.map(exception => ({
3401
+ ...exception,
3402
+ stacktrace: exception.stacktrace ? {
3403
+ ...exception.stacktrace,
3404
+ type: 'raw',
3405
+ frames: (exception.stacktrace.frames || []).map(frame => {
3406
+ return {
3407
+ ...frame,
3408
+ platform: 'node:javascript'
3409
+ };
3410
+ })
3411
+ } : undefined
3412
+ }));
3405
3413
  const properties = {
3406
3414
  // PostHog Exception Properties,
3407
3415
  $exception_message: exceptions[0]?.value || event.message,
3408
3416
  $exception_type: exceptions[0]?.type,
3409
3417
  $exception_personURL: personUrl,
3410
3418
  $exception_level: event.level,
3411
- $exception_list: exceptions,
3419
+ $exception_list: exceptionList,
3412
3420
  // Sentry Exception Properties
3413
3421
  $sentry_event_id: event.event_id,
3414
3422
  $sentry_exception: event.exception,