posthog-js 1.136.2 → 1.136.3
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/es.js +1 -1
- package/dist/es.js.map +1 -1
- package/dist/lib/src/posthog-core.d.ts +1 -1
- package/dist/module.d.ts +1 -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 +1 -1
- package/lib/src/posthog-core.js +12 -11
- package/lib/src/posthog-core.js.map +1 -1
- package/package.json +1 -1
package/lib/package.json
CHANGED
|
@@ -135,7 +135,7 @@ export declare class PostHog {
|
|
|
135
135
|
*/
|
|
136
136
|
capture(event_name: string, properties?: Properties | null, options?: CaptureOptions): CaptureResult | void;
|
|
137
137
|
_addCaptureHook(callback: (eventName: string) => void): void;
|
|
138
|
-
_calculate_event_properties(event_name: string, event_properties: Properties): Properties;
|
|
138
|
+
_calculate_event_properties(event_name: string, event_properties: Properties, options?: CaptureOptions): Properties;
|
|
139
139
|
_calculate_set_once_properties(dataSetOnce?: Properties): Properties | undefined;
|
|
140
140
|
/**
|
|
141
141
|
* Register a set of super properties, which are included with all
|
package/lib/src/posthog-core.js
CHANGED
|
@@ -596,7 +596,7 @@ var PostHog = /** @class */ (function () {
|
|
|
596
596
|
* @param {Date} [config.timestamp] Timestamp is a Date object. If not set, it'll automatically be set to the current time.
|
|
597
597
|
*/
|
|
598
598
|
PostHog.prototype.capture = function (event_name, properties, options) {
|
|
599
|
-
var _a
|
|
599
|
+
var _a;
|
|
600
600
|
// While developing, a developer might purposefully _not_ call init(),
|
|
601
601
|
// in this case, we would like capture to be a noop.
|
|
602
602
|
if (!this.__loaded || !this.persistence || !this.sessionPersistence || !this._requestQueue) {
|
|
@@ -638,14 +638,8 @@ var PostHog = /** @class */ (function () {
|
|
|
638
638
|
var data = {
|
|
639
639
|
uuid: uuidv7(),
|
|
640
640
|
event: event_name,
|
|
641
|
-
properties: this._calculate_event_properties(event_name, properties || {}),
|
|
641
|
+
properties: this._calculate_event_properties(event_name, properties || {}, options),
|
|
642
642
|
};
|
|
643
|
-
if (!(options === null || options === void 0 ? void 0 : options._noHeatmaps)) {
|
|
644
|
-
var heatmapsBuffer = (_a = this.heatmaps) === null || _a === void 0 ? void 0 : _a.getAndClearBuffer();
|
|
645
|
-
if (heatmapsBuffer) {
|
|
646
|
-
data.properties['$heatmap_data'] = heatmapsBuffer;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
643
|
if (clientRateLimitContext) {
|
|
650
644
|
data.properties['$lib_rate_limit_remaining_tokens'] = clientRateLimitContext.remainingTokens;
|
|
651
645
|
}
|
|
@@ -672,7 +666,7 @@ var PostHog = /** @class */ (function () {
|
|
|
672
666
|
this._debugEventEmitter.emit('eventCaptured', data);
|
|
673
667
|
var requestOptions = {
|
|
674
668
|
method: 'POST',
|
|
675
|
-
url: (
|
|
669
|
+
url: (_a = options === null || options === void 0 ? void 0 : options._url) !== null && _a !== void 0 ? _a : this.requestRouter.endpointFor('api', this.analyticsDefaultEndpoint),
|
|
676
670
|
data: data,
|
|
677
671
|
compression: 'best-available',
|
|
678
672
|
batchKey: options === null || options === void 0 ? void 0 : options._batchKey,
|
|
@@ -688,7 +682,8 @@ var PostHog = /** @class */ (function () {
|
|
|
688
682
|
PostHog.prototype._addCaptureHook = function (callback) {
|
|
689
683
|
this.on('eventCaptured', function (data) { return callback(data.event); });
|
|
690
684
|
};
|
|
691
|
-
PostHog.prototype._calculate_event_properties = function (event_name, event_properties) {
|
|
685
|
+
PostHog.prototype._calculate_event_properties = function (event_name, event_properties, options) {
|
|
686
|
+
var _a;
|
|
692
687
|
if (!this.persistence || !this.sessionPersistence) {
|
|
693
688
|
return event_properties;
|
|
694
689
|
}
|
|
@@ -703,7 +698,7 @@ var PostHog = /** @class */ (function () {
|
|
|
703
698
|
}
|
|
704
699
|
var infoProperties = Info.properties();
|
|
705
700
|
if (this.sessionManager) {
|
|
706
|
-
var
|
|
701
|
+
var _b = this.sessionManager.checkAndGetSessionAndWindowId(), sessionId = _b.sessionId, windowId = _b.windowId;
|
|
707
702
|
properties['$session_id'] = sessionId;
|
|
708
703
|
properties['$window_id'] = windowId;
|
|
709
704
|
}
|
|
@@ -747,6 +742,12 @@ var PostHog = /** @class */ (function () {
|
|
|
747
742
|
// update properties with pageview info and super-properties
|
|
748
743
|
properties = extend({}, infoProperties, this.persistence.properties(), this.sessionPersistence.properties(), properties);
|
|
749
744
|
properties['$is_identified'] = this._isIdentified();
|
|
745
|
+
if (!(options === null || options === void 0 ? void 0 : options._noHeatmaps)) {
|
|
746
|
+
var heatmapsBuffer = (_a = this.heatmaps) === null || _a === void 0 ? void 0 : _a.getAndClearBuffer();
|
|
747
|
+
if (heatmapsBuffer) {
|
|
748
|
+
properties['$heatmap_data'] = heatmapsBuffer;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
750
751
|
if (isArray(this.config.property_denylist)) {
|
|
751
752
|
each(this.config.property_denylist, function (denylisted_prop) {
|
|
752
753
|
delete properties[denylisted_prop];
|