posthog-js 1.32.1 → 1.32.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/CHANGELOG.md +8 -0
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/es.js +32 -26
- package/dist/es.js.map +1 -1
- package/dist/module.d.ts +3 -4
- package/dist/module.js +32 -26
- package/dist/module.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
package/dist/module.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ interface PostHogConfig {
|
|
|
166
166
|
opt_out_persistence_by_default: boolean;
|
|
167
167
|
opt_out_capturing_persistence_type: 'localStorage' | 'cookie';
|
|
168
168
|
opt_out_capturing_cookie_prefix: string | null;
|
|
169
|
-
|
|
169
|
+
opt_in_site_apps: boolean;
|
|
170
170
|
respect_dnt: boolean;
|
|
171
171
|
property_blacklist: string[];
|
|
172
172
|
xhr_headers: {
|
|
@@ -278,10 +278,9 @@ interface DecideResponse {
|
|
|
278
278
|
editorParams: EditorParams;
|
|
279
279
|
toolbarVersion: 'toolbar'; /** deprecated, moved to editorParams */
|
|
280
280
|
isAuthenticated: boolean;
|
|
281
|
-
|
|
281
|
+
siteApps: {
|
|
282
282
|
id: number;
|
|
283
|
-
|
|
284
|
-
config?: Record<string, any>;
|
|
283
|
+
url: string;
|
|
285
284
|
}[];
|
|
286
285
|
}
|
|
287
286
|
declare type FeatureFlagsCallback = (flags: string[], variants: Record<string, string | boolean>) => void;
|
package/dist/module.js
CHANGED
|
@@ -885,7 +885,7 @@ var LZString = {
|
|
|
885
885
|
}
|
|
886
886
|
};
|
|
887
887
|
|
|
888
|
-
var version = "1.32.
|
|
888
|
+
var version = "1.32.3";
|
|
889
889
|
|
|
890
890
|
// e.g. Config.DEBUG = Config.DEBUG || instance.get_config('debug')
|
|
891
891
|
|
|
@@ -4060,33 +4060,39 @@ var Decide = /*#__PURE__*/function () {
|
|
|
4060
4060
|
this.instance['compression'] = {};
|
|
4061
4061
|
}
|
|
4062
4062
|
|
|
4063
|
-
if (response['
|
|
4064
|
-
|
|
4065
|
-
|
|
4063
|
+
if (response['siteApps']) {
|
|
4064
|
+
if (this.instance.get_config('opt_in_site_apps')) {
|
|
4065
|
+
var apiHost = this.instance.get_config('api_host');
|
|
4066
4066
|
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
var
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
config
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4067
|
+
var _iterator2 = _createForOfIteratorHelper(response['siteApps']),
|
|
4068
|
+
_step2;
|
|
4069
|
+
|
|
4070
|
+
try {
|
|
4071
|
+
var _loop = function _loop() {
|
|
4072
|
+
var _step2$value = _step2.value,
|
|
4073
|
+
id = _step2$value.id,
|
|
4074
|
+
url = _step2$value.url;
|
|
4075
|
+
var script = document.createElement('script');
|
|
4076
|
+
script.src = [apiHost, apiHost[apiHost.length - 1] === '/' && url[0] === '/' ? url.substring(1) : url].join('');
|
|
4077
|
+
|
|
4078
|
+
script.onerror = function (e) {
|
|
4079
|
+
console.error("Error while initializing PostHog app with config id ".concat(id), e);
|
|
4080
|
+
};
|
|
4081
|
+
|
|
4082
|
+
window["__$$ph_web_js_".concat(id)] = _this2.instance;
|
|
4083
|
+
document.body.appendChild(script);
|
|
4084
|
+
};
|
|
4085
|
+
|
|
4086
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
4087
|
+
_loop();
|
|
4084
4088
|
}
|
|
4089
|
+
} catch (err) {
|
|
4090
|
+
_iterator2.e(err);
|
|
4091
|
+
} finally {
|
|
4092
|
+
_iterator2.f();
|
|
4085
4093
|
}
|
|
4086
|
-
}
|
|
4087
|
-
|
|
4088
|
-
} finally {
|
|
4089
|
-
_iterator2.f();
|
|
4094
|
+
} else if (response['siteApps'].length > 0) {
|
|
4095
|
+
console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');
|
|
4090
4096
|
}
|
|
4091
4097
|
}
|
|
4092
4098
|
}
|
|
@@ -6004,7 +6010,7 @@ var defaultConfig = function defaultConfig() {
|
|
|
6004
6010
|
opt_out_persistence_by_default: false,
|
|
6005
6011
|
opt_out_capturing_persistence_type: 'localStorage',
|
|
6006
6012
|
opt_out_capturing_cookie_prefix: null,
|
|
6007
|
-
|
|
6013
|
+
opt_in_site_apps: false,
|
|
6008
6014
|
property_blacklist: [],
|
|
6009
6015
|
respect_dnt: false,
|
|
6010
6016
|
sanitize_properties: null,
|