posthog-js 1.155.2 → 1.155.4
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/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/lib/src/posthog-core.d.ts +2 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +2 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/posthog-core.d.ts +2 -1
- package/lib/src/posthog-core.js +3 -1
- package/lib/src/posthog-core.js.map +1 -1
- package/package.json +1 -1
package/lib/package.json
CHANGED
|
@@ -59,6 +59,7 @@ export declare class PostHog {
|
|
|
59
59
|
__request_queue: QueuedRequestOptions[];
|
|
60
60
|
decideEndpointWasHit: boolean;
|
|
61
61
|
analyticsDefaultEndpoint: string;
|
|
62
|
+
version: string;
|
|
62
63
|
SentryIntegration: typeof SentryIntegration;
|
|
63
64
|
sentryIntegration: (options?: SentryIntegrationOptions) => ReturnType<typeof sentryIntegration>;
|
|
64
65
|
private _internalEventEmitter;
|
|
@@ -140,7 +141,7 @@ export declare class PostHog {
|
|
|
140
141
|
*/
|
|
141
142
|
capture(event_name: string, properties?: Properties | null, options?: CaptureOptions): CaptureResult | void;
|
|
142
143
|
_addCaptureHook(callback: (eventName: string, eventPayload?: CaptureResult) => void): void;
|
|
143
|
-
_calculate_event_properties(event_name: string, event_properties: Properties, timestamp
|
|
144
|
+
_calculate_event_properties(event_name: string, event_properties: Properties, timestamp?: Date): Properties;
|
|
144
145
|
_calculate_set_once_properties(dataSetOnce?: Properties): Properties | undefined;
|
|
145
146
|
/**
|
|
146
147
|
* Register a set of super properties, which are included with all
|
package/lib/src/posthog-core.js
CHANGED
|
@@ -204,6 +204,7 @@ var PostHog = /** @class */ (function () {
|
|
|
204
204
|
function PostHog() {
|
|
205
205
|
var _this = this;
|
|
206
206
|
this.webPerformance = new DeprecatedWebPerformanceObserver();
|
|
207
|
+
this.version = Config.LIB_VERSION;
|
|
207
208
|
this._internalEventEmitter = new SimpleEventEmitter();
|
|
208
209
|
this.config = defaultConfig();
|
|
209
210
|
this.decideEndpointWasHit = false;
|
|
@@ -303,7 +304,7 @@ var PostHog = /** @class */ (function () {
|
|
|
303
304
|
if (this.config.on_xhr_error) {
|
|
304
305
|
logger.error('[posthog] on_xhr_error is deprecated. Use on_request_error instead');
|
|
305
306
|
}
|
|
306
|
-
this.compression = config.disable_compression ? undefined : Compression.
|
|
307
|
+
this.compression = config.disable_compression ? undefined : Compression.GZipJS;
|
|
307
308
|
this.persistence = new PostHogPersistence(this.config);
|
|
308
309
|
this.sessionPersistence =
|
|
309
310
|
this.config.persistence === 'sessionStorage'
|
|
@@ -711,6 +712,7 @@ var PostHog = /** @class */ (function () {
|
|
|
711
712
|
this.on('eventCaptured', function (data) { return callback(data.event, data); });
|
|
712
713
|
};
|
|
713
714
|
PostHog.prototype._calculate_event_properties = function (event_name, event_properties, timestamp) {
|
|
715
|
+
timestamp = timestamp || new Date();
|
|
714
716
|
if (!this.persistence || !this.sessionPersistence) {
|
|
715
717
|
return event_properties;
|
|
716
718
|
}
|