posthog-js 1.35.0 → 1.36.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/es.js CHANGED
@@ -917,7 +917,7 @@ var LZString = {
917
917
  }
918
918
  };
919
919
 
920
- var version = "1.35.0";
920
+ var version = "1.36.0";
921
921
 
922
922
  // e.g. Config.DEBUG = Config.DEBUG || instance.get_config('debug')
923
923
 
@@ -5982,10 +5982,11 @@ var SentryIntegration = /*#__PURE__*/_createClass(function SentryIntegration(_po
5982
5982
 
5983
5983
  if (event.level !== 'error' || !_posthog.__loaded) return event;
5984
5984
  if (!event.tags) event.tags = {};
5985
- event.tags['PostHog Person URL'] = _posthog.config.api_host + '/person/' + _posthog.get_distinct_id();
5985
+ var host = _posthog.config.ui_host || _posthog.config.api_host;
5986
+ event.tags['PostHog Person URL'] = host + '/person/' + _posthog.get_distinct_id();
5986
5987
 
5987
5988
  if (_posthog.sessionRecordingStarted()) {
5988
- event.tags['PostHog Recording URL'] = _posthog.config.api_host + '/recordings/#sessionRecordingId=' + _posthog.sessionManager.checkAndGetSessionAndWindowId(true).sessionId;
5989
+ event.tags['PostHog Recording URL'] = host + '/recordings/#sessionRecordingId=' + _posthog.sessionManager.checkAndGetSessionAndWindowId(true).sessionId;
5989
5990
  }
5990
5991
 
5991
5992
  var exceptions = ((_event$exception = event.exception) === null || _event$exception === void 0 ? void 0 : _event$exception.values) || [];
@@ -6113,6 +6114,7 @@ var defaultConfig = function defaultConfig() {
6113
6114
  api_host: 'https://app.posthog.com',
6114
6115
  api_method: 'POST',
6115
6116
  api_transport: 'XHR',
6117
+ ui_host: null,
6116
6118
  token: '',
6117
6119
  autocapture: true,
6118
6120
  rageclick: false,
@@ -7253,12 +7255,17 @@ var PostHog = /*#__PURE__*/function () {
7253
7255
  * The default config is:
7254
7256
  *
7255
7257
  * {
7256
- * // Posthog host
7258
+ * // PostHog API host
7257
7259
  * api_host: 'https://app.posthog.com',
7258
7260
  *
7259
7261
  * // HTTP method for capturing requests
7260
7262
  * api_method: 'POST'
7261
7263
  *
7264
+ * // PostHog web app host, currently only used by the Sentry integration.
7265
+ * // This will only be different from api_host when using a reverse-proxied API host – in that case
7266
+ * // the original web app host needs to be passed here so that links to the web app are still convenient.
7267
+ * ui_host: 'https://app.posthog.com',
7268
+ *
7262
7269
  * // Automatically capture clicks, form submissions and change events
7263
7270
  * autocapture: true
7264
7271
  *