posthog-js
Advanced tools
Comparing version 1.144.2 to 1.145.0
import { PostHog } from '../../posthog-core'; | ||
import { DecideResponse, Properties } from '../../types'; | ||
export declare const BASE_ERROR_ENDPOINT = "/e/"; | ||
export declare class ExceptionObserver { | ||
@@ -11,2 +12,3 @@ private _endpoint; | ||
constructor(instance: PostHog); | ||
get endpoint(): string; | ||
get isEnabled(): boolean; | ||
@@ -13,0 +15,0 @@ get isCapturing(): boolean; |
{ | ||
"name": "posthog-js", | ||
"version": "1.144.2", | ||
"version": "1.145.0", | ||
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/PostHog/posthog-js", |
import { PostHog } from '../../posthog-core'; | ||
import { DecideResponse, Properties } from '../../types'; | ||
export declare const BASE_ERROR_ENDPOINT = "/e/"; | ||
export declare class ExceptionObserver { | ||
@@ -11,2 +12,3 @@ private _endpoint; | ||
constructor(instance: PostHog); | ||
get endpoint(): string; | ||
get isEnabled(): boolean; | ||
@@ -13,0 +15,0 @@ get isCapturing(): boolean; |
@@ -7,3 +7,3 @@ import { window } from '../../utils/globals'; | ||
// TODO: move this to /x/ as default | ||
var BASE_ENDPOINT = '/e/'; | ||
export var BASE_ERROR_ENDPOINT = '/e/'; | ||
var LOGGER_PREFIX = '[Exception Capture]'; | ||
@@ -13,4 +13,3 @@ var ExceptionObserver = /** @class */ (function () { | ||
var _this = this; | ||
var _a; | ||
this._endpoint = BASE_ENDPOINT; | ||
var _a, _b; | ||
this.originalOnUnhandledRejectionHandler = undefined; | ||
@@ -39,4 +38,13 @@ this.startCapturing = function () { | ||
this.remoteEnabled = !!((_a = this.instance.persistence) === null || _a === void 0 ? void 0 : _a.props[EXCEPTION_CAPTURE_ENABLED_SERVER_SIDE]); | ||
// TODO: once BASE_ERROR_ENDPOINT is no longer /e/ this can be removed | ||
this._endpoint = ((_b = this.instance.persistence) === null || _b === void 0 ? void 0 : _b.props[EXCEPTION_CAPTURE_ENDPOINT]) || BASE_ERROR_ENDPOINT; | ||
this.startIfEnabled(); | ||
} | ||
Object.defineProperty(ExceptionObserver.prototype, "endpoint", { | ||
get: function () { | ||
return this._endpoint; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(ExceptionObserver.prototype, "isEnabled", { | ||
@@ -94,4 +102,4 @@ get: function () { | ||
this._endpoint = isObject(autocaptureExceptionsResponse) | ||
? autocaptureExceptionsResponse.endpoint || BASE_ENDPOINT | ||
: BASE_ENDPOINT; | ||
? autocaptureExceptionsResponse.endpoint || BASE_ERROR_ENDPOINT | ||
: BASE_ERROR_ENDPOINT; | ||
if (this.instance.persistence) { | ||
@@ -101,3 +109,4 @@ this.instance.persistence.register((_a = {}, | ||
_a)); | ||
// when we come to moving the endpoint to not /e/ we'll want that to persist between startup and decide response | ||
// when we come to moving the endpoint to not /e/ | ||
// we'll want that to persist between startup and decide response | ||
// TODO: once BASE_ENDPOINT is no longer /e/ this can be removed | ||
@@ -123,3 +132,3 @@ this.instance.persistence.register((_b = {}, | ||
_noHeatmaps: true, | ||
_url: this._endpoint, | ||
_url: this.endpoint, | ||
}); | ||
@@ -126,0 +135,0 @@ }; |
@@ -18,2 +18,3 @@ /** | ||
*/ | ||
import { BASE_ERROR_ENDPOINT } from './exception-autocapture'; | ||
var NAME = 'posthog-js'; | ||
@@ -23,3 +24,3 @@ export function createEventProcessor(_posthog, _a) { | ||
return function (event) { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c, _d, _e, _f; | ||
var shouldProcessLevel = severityAllowList === '*' || severityAllowList.includes(event.level); | ||
@@ -59,3 +60,6 @@ if (!shouldProcessLevel || !_posthog.__loaded) | ||
} | ||
_posthog.capture('$exception', data); | ||
// we take the URL from the exception observer | ||
// so that when we add error specific URL for ingestion | ||
// these errors are sent there too | ||
_posthog.capture('$exception', data, { _url: ((_f = _posthog.exceptionObserver) === null || _f === void 0 ? void 0 : _f.endpoint) || BASE_ERROR_ENDPOINT }); | ||
return event; | ||
@@ -62,0 +66,0 @@ }; |
{ | ||
"name": "posthog-js", | ||
"version": "1.144.2", | ||
"version": "1.145.0", | ||
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/PostHog/posthog-js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7629518
24241