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/module.d.ts CHANGED
@@ -139,6 +139,7 @@ interface PostHogConfig {
139
139
  api_host: string;
140
140
  api_method: string;
141
141
  api_transport: string;
142
+ ui_host: string | null;
142
143
  token: string;
143
144
  autocapture: boolean;
144
145
  rageclick: boolean;
@@ -1148,12 +1149,17 @@ declare class PostHog {
1148
1149
  * The default config is:
1149
1150
  *
1150
1151
  * {
1151
- * // Posthog host
1152
+ * // PostHog API host
1152
1153
  * api_host: 'https://app.posthog.com',
1153
1154
  *
1154
1155
  * // HTTP method for capturing requests
1155
1156
  * api_method: 'POST'
1156
1157
  *
1158
+ * // PostHog web app host, currently only used by the Sentry integration.
1159
+ * // This will only be different from api_host when using a reverse-proxied API host – in that case
1160
+ * // the original web app host needs to be passed here so that links to the web app are still convenient.
1161
+ * ui_host: 'https://app.posthog.com',
1162
+ *
1157
1163
  * // Automatically capture clicks, form submissions and change events
1158
1164
  * autocapture: true
1159
1165
  *
package/dist/module.js CHANGED
@@ -921,7 +921,7 @@ var LZString = {
921
921
  }
922
922
  };
923
923
 
924
- var version = "1.35.0";
924
+ var version = "1.36.0";
925
925
 
926
926
  // e.g. Config.DEBUG = Config.DEBUG || instance.get_config('debug')
927
927
 
@@ -5986,10 +5986,11 @@ var SentryIntegration = /*#__PURE__*/_createClass(function SentryIntegration(_po
5986
5986
 
5987
5987
  if (event.level !== 'error' || !_posthog.__loaded) return event;
5988
5988
  if (!event.tags) event.tags = {};
5989
- event.tags['PostHog Person URL'] = _posthog.config.api_host + '/person/' + _posthog.get_distinct_id();
5989
+ var host = _posthog.config.ui_host || _posthog.config.api_host;
5990
+ event.tags['PostHog Person URL'] = host + '/person/' + _posthog.get_distinct_id();
5990
5991
 
5991
5992
  if (_posthog.sessionRecordingStarted()) {
5992
- event.tags['PostHog Recording URL'] = _posthog.config.api_host + '/recordings/#sessionRecordingId=' + _posthog.sessionManager.checkAndGetSessionAndWindowId(true).sessionId;
5993
+ event.tags['PostHog Recording URL'] = host + '/recordings/#sessionRecordingId=' + _posthog.sessionManager.checkAndGetSessionAndWindowId(true).sessionId;
5993
5994
  }
5994
5995
 
5995
5996
  var exceptions = ((_event$exception = event.exception) === null || _event$exception === void 0 ? void 0 : _event$exception.values) || [];
@@ -6117,6 +6118,7 @@ var defaultConfig = function defaultConfig() {
6117
6118
  api_host: 'https://app.posthog.com',
6118
6119
  api_method: 'POST',
6119
6120
  api_transport: 'XHR',
6121
+ ui_host: null,
6120
6122
  token: '',
6121
6123
  autocapture: true,
6122
6124
  rageclick: false,
@@ -7257,12 +7259,17 @@ var PostHog = /*#__PURE__*/function () {
7257
7259
  * The default config is:
7258
7260
  *
7259
7261
  * {
7260
- * // Posthog host
7262
+ * // PostHog API host
7261
7263
  * api_host: 'https://app.posthog.com',
7262
7264
  *
7263
7265
  * // HTTP method for capturing requests
7264
7266
  * api_method: 'POST'
7265
7267
  *
7268
+ * // PostHog web app host, currently only used by the Sentry integration.
7269
+ * // This will only be different from api_host when using a reverse-proxied API host – in that case
7270
+ * // the original web app host needs to be passed here so that links to the web app are still convenient.
7271
+ * ui_host: 'https://app.posthog.com',
7272
+ *
7266
7273
  * // Automatically capture clicks, form submissions and change events
7267
7274
  * autocapture: true
7268
7275
  *