posthog-node 5.19.0 → 5.20.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/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -9
- package/dist/client.mjs +16 -9
- package/dist/extensions/error-tracking/index.d.ts +1 -0
- package/dist/extensions/error-tracking/index.d.ts.map +1 -1
- package/dist/extensions/error-tracking/index.js +13 -8
- package/dist/extensions/error-tracking/index.mjs +14 -9
- package/dist/extensions/express.js +1 -0
- package/dist/extensions/express.mjs +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +2 -2
- package/src/client.ts +20 -11
- package/src/extensions/error-tracking/index.ts +17 -11
- package/src/extensions/express.ts +5 -0
- package/src/version.ts +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -821,7 +821,7 @@ export declare abstract class PostHogBackendClient extends PostHogCoreStateless
|
|
|
821
821
|
* @param distinctId - Optional user distinct ID
|
|
822
822
|
* @param additionalProperties - Optional additional properties to include
|
|
823
823
|
*/
|
|
824
|
-
captureException(error: unknown, distinctId?: string, additionalProperties?: Record<string | number, any
|
|
824
|
+
captureException(error: unknown, distinctId?: string, additionalProperties?: Record<string | number, any>, uuid?: EventMessage['uuid']): void;
|
|
825
825
|
/**
|
|
826
826
|
* Capture an error exception as an event immediately (synchronously).
|
|
827
827
|
*
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,oBAAoB,EAEpB,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,wBAAwB,EACxB,qBAAqB,EAGtB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,YAAY,EAIZ,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,2BAA2B,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upProperties
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
captureException(error, distinctId, additionalProperties) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
484
|
+
captureException(error, distinctId, additionalProperties, uuid) {
|
|
485
|
+
if (!index_js_default().isPreviouslyCapturedError(error)) {
|
|
486
|
+
const syntheticException = new Error('PostHog syntheticException');
|
|
487
|
+
this.addPendingPromise(index_js_default().buildEventMessage(error, {
|
|
488
|
+
syntheticException
|
|
489
|
+
}, distinctId, additionalProperties).then((msg)=>this.capture({
|
|
490
|
+
...msg,
|
|
491
|
+
uuid
|
|
492
|
+
})));
|
|
493
|
+
}
|
|
489
494
|
}
|
|
490
495
|
async captureExceptionImmediate(error, distinctId, additionalProperties) {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
496
|
+
if (!index_js_default().isPreviouslyCapturedError(error)) {
|
|
497
|
+
const syntheticException = new Error('PostHog syntheticException');
|
|
498
|
+
this.addPendingPromise(index_js_default().buildEventMessage(error, {
|
|
499
|
+
syntheticException
|
|
500
|
+
}, distinctId, additionalProperties).then((msg)=>this.captureImmediate(msg)));
|
|
501
|
+
}
|
|
495
502
|
}
|
|
496
503
|
async prepareEventMessage(props) {
|
|
497
504
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
package/dist/client.mjs
CHANGED
|
@@ -443,17 +443,24 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
443
443
|
allGroupProperties
|
|
444
444
|
};
|
|
445
445
|
}
|
|
446
|
-
captureException(error, distinctId, additionalProperties) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
446
|
+
captureException(error, distinctId, additionalProperties, uuid) {
|
|
447
|
+
if (!error_tracking.isPreviouslyCapturedError(error)) {
|
|
448
|
+
const syntheticException = new Error('PostHog syntheticException');
|
|
449
|
+
this.addPendingPromise(error_tracking.buildEventMessage(error, {
|
|
450
|
+
syntheticException
|
|
451
|
+
}, distinctId, additionalProperties).then((msg)=>this.capture({
|
|
452
|
+
...msg,
|
|
453
|
+
uuid
|
|
454
|
+
})));
|
|
455
|
+
}
|
|
451
456
|
}
|
|
452
457
|
async captureExceptionImmediate(error, distinctId, additionalProperties) {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
458
|
+
if (!error_tracking.isPreviouslyCapturedError(error)) {
|
|
459
|
+
const syntheticException = new Error('PostHog syntheticException');
|
|
460
|
+
this.addPendingPromise(error_tracking.buildEventMessage(error, {
|
|
461
|
+
syntheticException
|
|
462
|
+
}, distinctId, additionalProperties).then((msg)=>this.captureImmediate(msg)));
|
|
463
|
+
}
|
|
457
464
|
}
|
|
458
465
|
async prepareEventMessage(props) {
|
|
459
466
|
const { distinctId, event, properties, groups, sendFeatureFlags, timestamp, disableGeoip, uuid } = props;
|
|
@@ -9,6 +9,7 @@ export default class ErrorTracking {
|
|
|
9
9
|
private _logger;
|
|
10
10
|
static errorPropertiesBuilder: CoreErrorTracking.ErrorPropertiesBuilder;
|
|
11
11
|
constructor(client: PostHogBackendClient, options: PostHogOptions, _logger: Logger);
|
|
12
|
+
static isPreviouslyCapturedError(x: unknown): boolean;
|
|
12
13
|
static buildEventMessage(error: unknown, hint: CoreErrorTracking.EventHint, distinctId?: string, additionalProperties?: Record<string | number, any>): Promise<EventMessage>;
|
|
13
14
|
private startAutocaptureIfEnabled;
|
|
14
15
|
private onException;
|
|
@@ -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,iBA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IAwBxB,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,WAAW;YAoBL,YAAY;IAM1B,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,IAAI;CAGjB"}
|
|
@@ -42,6 +42,9 @@ class ErrorTracking {
|
|
|
42
42
|
});
|
|
43
43
|
this.startAutocaptureIfEnabled();
|
|
44
44
|
}
|
|
45
|
+
static isPreviouslyCapturedError(x) {
|
|
46
|
+
return (0, core_namespaceObject.isObject)(x) && '__posthog_previously_captured_error' in x && true === x.__posthog_previously_captured_error;
|
|
47
|
+
}
|
|
45
48
|
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
46
49
|
const properties = {
|
|
47
50
|
...additionalProperties
|
|
@@ -66,14 +69,16 @@ class ErrorTracking {
|
|
|
66
69
|
}
|
|
67
70
|
onException(exception, hint) {
|
|
68
71
|
this.client.addPendingPromise((async ()=>{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
exception
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
if (!ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
73
|
+
const eventMessage = await ErrorTracking.buildEventMessage(exception, hint);
|
|
74
|
+
const exceptionProperties = eventMessage.properties;
|
|
75
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? 'Exception';
|
|
76
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
77
|
+
if (isRateLimited) return void this._logger.info('Skipping exception capture because of client rate limiting.', {
|
|
78
|
+
exception: exceptionType
|
|
79
|
+
});
|
|
80
|
+
return this.client.capture(eventMessage);
|
|
81
|
+
}
|
|
77
82
|
})());
|
|
78
83
|
}
|
|
79
84
|
async onFatalError(exception) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addUncaughtExceptionListener, addUnhandledRejectionListener } from "./autocapture.mjs";
|
|
2
|
-
import { BucketedRateLimiter, uuidv7 } from "@posthog/core";
|
|
2
|
+
import { BucketedRateLimiter, isObject, uuidv7 } from "@posthog/core";
|
|
3
3
|
const SHUTDOWN_TIMEOUT = 2000;
|
|
4
4
|
class ErrorTracking {
|
|
5
5
|
constructor(client, options, _logger){
|
|
@@ -14,6 +14,9 @@ class ErrorTracking {
|
|
|
14
14
|
});
|
|
15
15
|
this.startAutocaptureIfEnabled();
|
|
16
16
|
}
|
|
17
|
+
static isPreviouslyCapturedError(x) {
|
|
18
|
+
return isObject(x) && '__posthog_previously_captured_error' in x && true === x.__posthog_previously_captured_error;
|
|
19
|
+
}
|
|
17
20
|
static async buildEventMessage(error, hint, distinctId, additionalProperties) {
|
|
18
21
|
const properties = {
|
|
19
22
|
...additionalProperties
|
|
@@ -38,14 +41,16 @@ class ErrorTracking {
|
|
|
38
41
|
}
|
|
39
42
|
onException(exception, hint) {
|
|
40
43
|
this.client.addPendingPromise((async ()=>{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
exception
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
if (!ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
45
|
+
const eventMessage = await ErrorTracking.buildEventMessage(exception, hint);
|
|
46
|
+
const exceptionProperties = eventMessage.properties;
|
|
47
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? 'Exception';
|
|
48
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType);
|
|
49
|
+
if (isRateLimited) return void this._logger.info('Skipping exception capture because of client rate limiting.', {
|
|
50
|
+
exception: exceptionType
|
|
51
|
+
});
|
|
52
|
+
return this.client.capture(eventMessage);
|
|
53
|
+
}
|
|
49
54
|
})());
|
|
50
55
|
}
|
|
51
56
|
async onFatalError(exception) {
|
|
@@ -42,6 +42,7 @@ function setupExpressErrorHandler(_posthog, app) {
|
|
|
42
42
|
}
|
|
43
43
|
function posthogErrorHandler(posthog) {
|
|
44
44
|
return (error, req, res, next)=>{
|
|
45
|
+
if (index_js_default().isPreviouslyCapturedError(error)) return void next(error);
|
|
45
46
|
const sessionId = req.headers['x-posthog-session-id'];
|
|
46
47
|
const distinctId = req.headers['x-posthog-distinct-id'];
|
|
47
48
|
const syntheticException = new Error('Synthetic exception');
|
|
@@ -4,6 +4,7 @@ function setupExpressErrorHandler(_posthog, app) {
|
|
|
4
4
|
}
|
|
5
5
|
function posthogErrorHandler(posthog) {
|
|
6
6
|
return (error, req, res, next)=>{
|
|
7
|
+
if (error_tracking.isPreviouslyCapturedError(error)) return void next(error);
|
|
7
8
|
const sessionId = req.headers['x-posthog-session-id'];
|
|
8
9
|
const distinctId = req.headers['x-posthog-distinct-id'];
|
|
9
10
|
const syntheticException = new Error('Synthetic exception');
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.20.0";
|
|
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.
|
|
29
|
+
const version = '5.20.0';
|
|
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.
|
|
1
|
+
const version = '5.20.0';
|
|
2
2
|
export { version };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "posthog-node",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.20.0",
|
|
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.9.
|
|
28
|
+
"@posthog/core": "1.9.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@rslib/core": "0.10.6",
|
package/src/client.ts
CHANGED
|
@@ -1595,13 +1595,20 @@ export abstract class PostHogBackendClient extends PostHogCoreStateless implemen
|
|
|
1595
1595
|
* @param distinctId - Optional user distinct ID
|
|
1596
1596
|
* @param additionalProperties - Optional additional properties to include
|
|
1597
1597
|
*/
|
|
1598
|
-
captureException(
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1598
|
+
captureException(
|
|
1599
|
+
error: unknown,
|
|
1600
|
+
distinctId?: string,
|
|
1601
|
+
additionalProperties?: Record<string | number, any>,
|
|
1602
|
+
uuid?: EventMessage['uuid']
|
|
1603
|
+
): void {
|
|
1604
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
1605
|
+
const syntheticException = new Error('PostHog syntheticException')
|
|
1606
|
+
this.addPendingPromise(
|
|
1607
|
+
ErrorTracking.buildEventMessage(error, { syntheticException }, distinctId, additionalProperties).then((msg) =>
|
|
1608
|
+
this.capture({ ...msg, uuid })
|
|
1609
|
+
)
|
|
1603
1610
|
)
|
|
1604
|
-
|
|
1611
|
+
}
|
|
1605
1612
|
}
|
|
1606
1613
|
|
|
1607
1614
|
/**
|
|
@@ -1644,12 +1651,14 @@ export abstract class PostHogBackendClient extends PostHogCoreStateless implemen
|
|
|
1644
1651
|
distinctId?: string,
|
|
1645
1652
|
additionalProperties?: Record<string | number, any>
|
|
1646
1653
|
): Promise<void> {
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1654
|
+
if (!ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
1655
|
+
const syntheticException = new Error('PostHog syntheticException')
|
|
1656
|
+
this.addPendingPromise(
|
|
1657
|
+
ErrorTracking.buildEventMessage(error, { syntheticException }, distinctId, additionalProperties).then((msg) =>
|
|
1658
|
+
this.captureImmediate(msg)
|
|
1659
|
+
)
|
|
1651
1660
|
)
|
|
1652
|
-
|
|
1661
|
+
}
|
|
1653
1662
|
}
|
|
1654
1663
|
|
|
1655
1664
|
public async prepareEventMessage(props: EventMessage): Promise<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { addUncaughtExceptionListener, addUnhandledRejectionListener } from './autocapture'
|
|
2
2
|
import { PostHogBackendClient } from '@/client'
|
|
3
|
-
import { uuidv7 } from '@posthog/core'
|
|
3
|
+
import { isObject, uuidv7 } 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'
|
|
@@ -34,6 +34,10 @@ export default class ErrorTracking {
|
|
|
34
34
|
this.startAutocaptureIfEnabled()
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
static isPreviouslyCapturedError(x: unknown): boolean {
|
|
38
|
+
return isObject(x) && '__posthog_previously_captured_error' in x && x.__posthog_previously_captured_error === true
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
static async buildEventMessage(
|
|
38
42
|
error: unknown,
|
|
39
43
|
hint: CoreErrorTracking.EventHint,
|
|
@@ -73,17 +77,19 @@ export default class ErrorTracking {
|
|
|
73
77
|
private onException(exception: unknown, hint: CoreErrorTracking.EventHint): void {
|
|
74
78
|
this.client.addPendingPromise(
|
|
75
79
|
(async () => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
exception
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
if (!ErrorTracking.isPreviouslyCapturedError(exception)) {
|
|
81
|
+
const eventMessage = await ErrorTracking.buildEventMessage(exception, hint)
|
|
82
|
+
const exceptionProperties = eventMessage.properties
|
|
83
|
+
const exceptionType = exceptionProperties?.$exception_list[0]?.type ?? 'Exception'
|
|
84
|
+
const isRateLimited = this._rateLimiter.consumeRateLimit(exceptionType)
|
|
85
|
+
if (isRateLimited) {
|
|
86
|
+
this._logger.info('Skipping exception capture because of client rate limiting.', {
|
|
87
|
+
exception: exceptionType,
|
|
88
|
+
})
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
return this.client.capture(eventMessage)
|
|
85
92
|
}
|
|
86
|
-
return this.client.capture(eventMessage)
|
|
87
93
|
})()
|
|
88
94
|
)
|
|
89
95
|
}
|
|
@@ -32,6 +32,11 @@ export function setupExpressErrorHandler(
|
|
|
32
32
|
|
|
33
33
|
function posthogErrorHandler(posthog: PostHogBackendClient): ExpressErrorMiddleware {
|
|
34
34
|
return (error: MiddlewareError, req, res, next: (error: MiddlewareError) => void): void => {
|
|
35
|
+
if (ErrorTracking.isPreviouslyCapturedError(error)) {
|
|
36
|
+
next(error)
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
const sessionId: string | undefined = req.headers['x-posthog-session-id'] as string | undefined
|
|
36
41
|
const distinctId: string | undefined = req.headers['x-posthog-distinct-id'] as string | undefined
|
|
37
42
|
const syntheticException = new Error('Synthetic exception')
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.20.0'
|