posthog-js 1.207.2 → 1.207.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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posthog-js",
3
- "version": "1.207.2",
3
+ "version": "1.207.4",
4
4
  "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",
5
5
  "repository": "https://github.com/PostHog/posthog-js",
6
6
  "author": "hey@posthog.com",
@@ -32,9 +32,12 @@ export function createEventProcessor(_posthog, _a) {
32
32
  event.tags['PostHog Recording URL'] = _posthog.get_session_replay_url({ withTimestamp: true });
33
33
  }
34
34
  var exceptions = ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || [];
35
- exceptions.map(function (exception) {
35
+ exceptions.forEach(function (exception) {
36
36
  if (exception.stacktrace) {
37
37
  exception.stacktrace.type = 'raw';
38
+ exception.stacktrace.frames.forEach(function (frame) {
39
+ frame.platform = 'web:javascript';
40
+ });
38
41
  }
39
42
  });
40
43
  var data = {
@@ -1 +1 @@
1
- {"version":3,"file":"sentry-integration.js","sourceRoot":"","sources":["../../../src/extensions/sentry-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAkDH,IAAM,IAAI,GAAG,YAAY,CAAA;AAEzB,MAAM,UAAU,oBAAoB,CAChC,QAAiB,EACjB,EAAiG;QAAjG,qBAA+F,EAAE,KAAA,EAA/F,YAAY,kBAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,yBAA6B,EAA7B,iBAAiB,mBAAG,CAAC,OAAO,CAAC,KAAA;IAEhE,OAAO,UAAC,KAAK;;QACT,IAAM,kBAAkB,GAAG,iBAAiB,KAAK,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAsB,CAAC,CAAA;QAChH,IAAI,CAAC,kBAAkB,IAAI,CAAC,QAAQ,CAAC,QAAQ;YAAE,OAAO,KAAK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YAChE,sBAAsB,EAAE,MAAA,UAAU,CAAC,CAAC,CAAC,0CAAE,IAAI;YAC3C,YAAY,EAAE,KAAK,CAAC,IAAI;SAC3B,CAAA;QAED,IAAI,YAAY,IAAI,SAAS,EAAE,CAAC;YAC5B,IAAI,CAAC,aAAa,CAAC;gBACf,CAAC,MAAM,IAAI,kCAAkC,CAAC;oBAC9C,YAAY;oBACZ,mBAAmB;oBACnB,SAAS;oBACT,SAAS;oBACT,KAAK,CAAC,QAAQ,CAAA;QACtB,CAAC;QAED,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAE5C,OAAO,KAAK,CAAA;IAChB,CAAC,CAAA;AACL,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,iBAAiB,CAAC,QAAiB,EAAE,OAAkC;IACnF,IAAM,SAAS,GAAG,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzD,OAAO;QACH,IAAI,EAAE,IAAI;QACV,YAAY,YAAC,KAAK;YACd,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;QAC3B,CAAC;KACJ,CAAA;AACL,CAAC;AACD,+BAA+B;AAC/B;IAQI,2BACI,QAAiB,EACjB,YAAqB,EACrB,SAAkB,EAClB,MAAe,EACf,iBAAyC;QAEzC,gEAAgE;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,SAAS,GAAG,UAAU,uBAAkE;YACzF,uBAAuB,CACnB,oBAAoB,CAAC,QAAQ,EAAE,EAAE,YAAY,cAAA,EAAE,SAAS,WAAA,EAAE,MAAM,QAAA,EAAE,iBAAiB,mBAAA,EAAE,CAAC,CACzF,CAAA;QACL,CAAC,CAAA;IACL,CAAC;IACL,wBAAC;AAAD,CAAC,AAvBD,IAuBC","sourcesContent":["/**\n * Integrate Sentry with PostHog. This will add a direct link to the person in Sentry, and an $exception event in PostHog\n *\n * ### Usage\n *\n * Sentry.init({\n * dsn: 'https://example',\n * integrations: [\n * new posthog.SentryIntegration(posthog)\n * ]\n * })\n *\n * @param {Object} [posthog] The posthog object\n * @param {string} [organization] Optional: The Sentry organization, used to send a direct link from PostHog to Sentry\n * @param {Number} [projectId] Optional: The Sentry project id, used to send a direct link from PostHog to Sentry\n * @param {string} [prefix] Optional: Url of a self-hosted sentry instance (default: https://sentry.io/organizations/)\n * @param {SeverityLevel[] | '*'} [severityAllowList] Optional: send events matching the provided levels. Use '*' to send all events (default: ['error'])\n */\n\nimport { PostHog } from '../posthog-core'\nimport { SeverityLevel } from '../types'\n\n// NOTE - we can't import from @sentry/types because it changes frequently and causes clashes\n// We only use a small subset of the types, so we can just define the integration overall and use any for the rest\n\n// import {\n// Event as _SentryEvent,\n// EventProcessor as _SentryEventProcessor,\n// Hub as _SentryHub,\n// Integration as _SentryIntegration,\n// SeverityLevel as _SeverityLevel,\n// IntegrationClass as _SentryIntegrationClass,\n// } from '@sentry/types'\n\n// Uncomment the above and comment the below to get type checking for development\n\ntype _SentryEvent = any\ntype _SentryException = any\ntype _SentryEventProcessor = any\ntype _SentryHub = any\n\ninterface _SentryIntegration {\n name: string\n processEvent(event: _SentryEvent): _SentryEvent\n}\n\ninterface _SentryIntegrationClass {\n name: string\n setupOnce(addGlobalEventProcessor: (callback: _SentryEventProcessor) => void, getCurrentHub: () => _SentryHub): void\n}\n\ninterface SentryExceptionProperties {\n $sentry_event_id: any\n $sentry_exception: any\n $sentry_exception_message: any\n $sentry_exception_type: any\n $sentry_tags: any\n $sentry_url?: string\n}\n\nexport type SentryIntegrationOptions = {\n organization?: string\n projectId?: number\n prefix?: string\n severityAllowList?: SeverityLevel[] | '*'\n}\n\nconst NAME = 'posthog-js'\n\nexport function createEventProcessor(\n _posthog: PostHog,\n { organization, projectId, prefix, severityAllowList = ['error'] }: SentryIntegrationOptions = {}\n): (event: _SentryEvent) => _SentryEvent {\n return (event) => {\n const shouldProcessLevel = severityAllowList === '*' || severityAllowList.includes(event.level as SeverityLevel)\n if (!shouldProcessLevel || !_posthog.__loaded) return event\n if (!event.tags) event.tags = {}\n\n const personUrl = _posthog.requestRouter.endpointFor(\n 'ui',\n `/project/${_posthog.config.token}/person/${_posthog.get_distinct_id()}`\n )\n event.tags['PostHog Person URL'] = personUrl\n if (_posthog.sessionRecordingStarted()) {\n event.tags['PostHog Recording URL'] = _posthog.get_session_replay_url({ withTimestamp: true })\n }\n\n const exceptions: _SentryException[] = event.exception?.values || []\n\n exceptions.map((exception) => {\n if (exception.stacktrace) {\n exception.stacktrace.type = 'raw'\n }\n })\n\n const data: SentryExceptionProperties & {\n // two properties added to match any exception auto-capture\n // added manually to avoid any dependency on the lazily loaded content\n $exception_message: any\n $exception_type: any\n $exception_list: any\n $exception_personURL: string\n $exception_level: SeverityLevel\n } = {\n // PostHog Exception Properties,\n $exception_message: exceptions[0]?.value || event.message,\n $exception_type: exceptions[0]?.type,\n $exception_personURL: personUrl,\n $exception_level: event.level,\n $exception_list: exceptions,\n // Sentry Exception Properties\n $sentry_event_id: event.event_id,\n $sentry_exception: event.exception,\n $sentry_exception_message: exceptions[0]?.value || event.message,\n $sentry_exception_type: exceptions[0]?.type,\n $sentry_tags: event.tags,\n }\n\n if (organization && projectId) {\n data['$sentry_url'] =\n (prefix || 'https://sentry.io/organizations/') +\n organization +\n '/issues/?project=' +\n projectId +\n '&query=' +\n event.event_id\n }\n\n _posthog.exceptions.sendExceptionEvent(data)\n\n return event\n }\n}\n\n// V8 integration - function based\nexport function sentryIntegration(_posthog: PostHog, options?: SentryIntegrationOptions): _SentryIntegration {\n const processor = createEventProcessor(_posthog, options)\n return {\n name: NAME,\n processEvent(event) {\n return processor(event)\n },\n }\n}\n// V7 integration - class based\nexport class SentryIntegration implements _SentryIntegrationClass {\n name: string\n\n setupOnce: (\n addGlobalEventProcessor: (callback: _SentryEventProcessor) => void,\n getCurrentHub: () => _SentryHub\n ) => void\n\n constructor(\n _posthog: PostHog,\n organization?: string,\n projectId?: number,\n prefix?: string,\n severityAllowList?: SeverityLevel[] | '*'\n ) {\n // setupOnce gets called by Sentry when it intializes the plugin\n this.name = NAME\n this.setupOnce = function (addGlobalEventProcessor: (callback: _SentryEventProcessor) => void) {\n addGlobalEventProcessor(\n createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList })\n )\n }\n }\n}\n"]}
1
+ {"version":3,"file":"sentry-integration.js","sourceRoot":"","sources":["../../../src/extensions/sentry-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAkDH,IAAM,IAAI,GAAG,YAAY,CAAA;AAEzB,MAAM,UAAU,oBAAoB,CAChC,QAAiB,EACjB,EAAiG;QAAjG,qBAA+F,EAAE,KAAA,EAA/F,YAAY,kBAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,yBAA6B,EAA7B,iBAAiB,mBAAG,CAAC,OAAO,CAAC,KAAA;IAEhE,OAAO,UAAC,KAAK;;QACT,IAAM,kBAAkB,GAAG,iBAAiB,KAAK,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAsB,CAAC,CAAA;QAChH,IAAI,CAAC,kBAAkB,IAAI,CAAC,QAAQ,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAA;QAC3D,IAAI,CAAC,KAAK,CAAC,IAAI;YAAE,KAAK,CAAC,IAAI,GAAG,EAAE,CAAA;QAEhC,IAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,CAChD,IAAI,EACJ,mBAAY,QAAQ,CAAC,MAAM,CAAC,KAAK,qBAAW,QAAQ,CAAC,eAAe,EAAE,CAAE,CAC3E,CAAA;QACD,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAA;QAC5C,IAAI,QAAQ,CAAC,uBAAuB,EAAE,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,C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,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAE5C,OAAO,KAAK,CAAA;IAChB,CAAC,CAAA;AACL,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,iBAAiB,CAAC,QAAiB,EAAE,OAAkC;IACnF,IAAM,SAAS,GAAG,oBAAoB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzD,OAAO;QACH,IAAI,EAAE,IAAI;QACV,YAAY,YAAC,KAAK;YACd,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;QAC3B,CAAC;KACJ,CAAA;AACL,CAAC;AACD,+BAA+B;AAC/B;IAQI,2BACI,QAAiB,EACjB,YAAqB,EACrB,SAAkB,EAClB,MAAe,EACf,iBAAyC;QAEzC,gEAAgE;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,SAAS,GAAG,UAAU,uBAAkE;YACzF,uBAAuB,CACnB,oBAAoB,CAAC,QAAQ,EAAE,EAAE,YAAY,cAAA,EAAE,SAAS,WAAA,EAAE,MAAM,QAAA,EAAE,iBAAiB,mBAAA,EAAE,CAAC,CACzF,CAAA;QACL,CAAC,CAAA;IACL,CAAC;IACL,wBAAC;AAAD,CAAC,AAvBD,IAuBC","sourcesContent":["/**\n * Integrate Sentry with PostHog. This will add a direct link to the person in Sentry, and an $exception event in PostHog\n *\n * ### Usage\n *\n * Sentry.init({\n * dsn: 'https://example',\n * integrations: [\n * new posthog.SentryIntegration(posthog)\n * ]\n * })\n *\n * @param {Object} [posthog] The posthog object\n * @param {string} [organization] Optional: The Sentry organization, used to send a direct link from PostHog to Sentry\n * @param {Number} [projectId] Optional: The Sentry project id, used to send a direct link from PostHog to Sentry\n * @param {string} [prefix] Optional: Url of a self-hosted sentry instance (default: https://sentry.io/organizations/)\n * @param {SeverityLevel[] | '*'} [severityAllowList] Optional: send events matching the provided levels. Use '*' to send all events (default: ['error'])\n */\n\nimport { PostHog } from '../posthog-core'\nimport { SeverityLevel } from '../types'\n\n// NOTE - we can't import from @sentry/types because it changes frequently and causes clashes\n// We only use a small subset of the types, so we can just define the integration overall and use any for the rest\n\n// import {\n// Event as _SentryEvent,\n// EventProcessor as _SentryEventProcessor,\n// Hub as _SentryHub,\n// Integration as _SentryIntegration,\n// SeverityLevel as _SeverityLevel,\n// IntegrationClass as _SentryIntegrationClass,\n// } from '@sentry/types'\n\n// Uncomment the above and comment the below to get type checking for development\n\ntype _SentryEvent = any\ntype _SentryException = any\ntype _SentryEventProcessor = any\ntype _SentryHub = any\n\ninterface _SentryIntegration {\n name: string\n processEvent(event: _SentryEvent): _SentryEvent\n}\n\ninterface _SentryIntegrationClass {\n name: string\n setupOnce(addGlobalEventProcessor: (callback: _SentryEventProcessor) => void, getCurrentHub: () => _SentryHub): void\n}\n\ninterface SentryExceptionProperties {\n $sentry_event_id: any\n $sentry_exception: any\n $sentry_exception_message: any\n $sentry_exception_type: any\n $sentry_tags: any\n $sentry_url?: string\n}\n\nexport type SentryIntegrationOptions = {\n organization?: string\n projectId?: number\n prefix?: string\n severityAllowList?: SeverityLevel[] | '*'\n}\n\nconst NAME = 'posthog-js'\n\nexport function createEventProcessor(\n _posthog: PostHog,\n { organization, projectId, prefix, severityAllowList = ['error'] }: SentryIntegrationOptions = {}\n): (event: _SentryEvent) => _SentryEvent {\n return (event) => {\n const shouldProcessLevel = severityAllowList === '*' || severityAllowList.includes(event.level as SeverityLevel)\n if (!shouldProcessLevel || !_posthog.__loaded) return event\n if (!event.tags) event.tags = {}\n\n const personUrl = _posthog.requestRouter.endpointFor(\n 'ui',\n `/project/${_posthog.config.token}/person/${_posthog.get_distinct_id()}`\n )\n event.tags['PostHog Person URL'] = personUrl\n if (_posthog.sessionRecordingStarted()) {\n event.tags['PostHog Recording URL'] = _posthog.get_session_replay_url({ withTimestamp: true })\n }\n\n const exceptions: _SentryException[] = event.exception?.values || []\n\n exceptions.forEach((exception) => {\n if (exception.stacktrace) {\n exception.stacktrace.type = 'raw'\n\n exception.stacktrace.frames.forEach((frame: any) => {\n frame.platform = 'web:javascript'\n })\n }\n })\n\n const data: SentryExceptionProperties & {\n // two properties added to match any exception auto-capture\n // added manually to avoid any dependency on the lazily loaded content\n $exception_message: any\n $exception_type: any\n $exception_list: any\n $exception_personURL: string\n $exception_level: SeverityLevel\n } = {\n // PostHog Exception Properties,\n $exception_message: exceptions[0]?.value || event.message,\n $exception_type: exceptions[0]?.type,\n $exception_personURL: personUrl,\n $exception_level: event.level,\n $exception_list: exceptions,\n // Sentry Exception Properties\n $sentry_event_id: event.event_id,\n $sentry_exception: event.exception,\n $sentry_exception_message: exceptions[0]?.value || event.message,\n $sentry_exception_type: exceptions[0]?.type,\n $sentry_tags: event.tags,\n }\n\n if (organization && projectId) {\n data['$sentry_url'] =\n (prefix || 'https://sentry.io/organizations/') +\n organization +\n '/issues/?project=' +\n projectId +\n '&query=' +\n event.event_id\n }\n\n _posthog.exceptions.sendExceptionEvent(data)\n\n return event\n }\n}\n\n// V8 integration - function based\nexport function sentryIntegration(_posthog: PostHog, options?: SentryIntegrationOptions): _SentryIntegration {\n const processor = createEventProcessor(_posthog, options)\n return {\n name: NAME,\n processEvent(event) {\n return processor(event)\n },\n }\n}\n// V7 integration - class based\nexport class SentryIntegration implements _SentryIntegrationClass {\n name: string\n\n setupOnce: (\n addGlobalEventProcessor: (callback: _SentryEventProcessor) => void,\n getCurrentHub: () => _SentryHub\n ) => void\n\n constructor(\n _posthog: PostHog,\n organization?: string,\n projectId?: number,\n prefix?: string,\n severityAllowList?: SeverityLevel[] | '*'\n ) {\n // setupOnce gets called by Sentry when it intializes the plugin\n this.name = NAME\n this.setupOnce = function (addGlobalEventProcessor: (callback: _SentryEventProcessor) => void) {\n addGlobalEventProcessor(\n createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList })\n )\n }\n }\n}\n"]}
@@ -1682,21 +1682,20 @@ var PostHog = /** @class */ (function () {
1682
1682
  var _a;
1683
1683
  var syntheticException = new Error('PostHog syntheticException');
1684
1684
  var properties = isFunction((_a = assignableWindow.__PosthogExtensions__) === null || _a === void 0 ? void 0 : _a.parseErrorAsProperties)
1685
- ? assignableWindow.__PosthogExtensions__.parseErrorAsProperties([error.message, undefined, undefined, undefined, error],
1685
+ ? __assign(__assign({}, assignableWindow.__PosthogExtensions__.parseErrorAsProperties([error.message, undefined, undefined, undefined, error],
1686
1686
  // create synthetic error to get stack in cases where user input does not contain one
1687
- // creating the exceptionas soon into our code as possible means we should only have to
1687
+ // creating the exceptions soon into our code as possible means we should only have to
1688
1688
  // remove a single frame (this 'captureException' method) from the resultant stack
1689
- { syntheticException: syntheticException })
1690
- : __assign({ $exception_level: 'error', $exception_list: [
1691
- {
1692
- type: error.name,
1693
- value: error.message,
1694
- mechanism: {
1695
- handled: true,
1696
- synthetic: false,
1697
- },
1689
+ { syntheticException: syntheticException })), additionalProperties) : __assign({ $exception_level: 'error', $exception_list: [
1690
+ {
1691
+ type: error.name,
1692
+ value: error.message,
1693
+ mechanism: {
1694
+ handled: true,
1695
+ synthetic: false,
1698
1696
  },
1699
- ] }, additionalProperties);
1697
+ },
1698
+ ] }, additionalProperties);
1700
1699
  this.exceptions.sendExceptionEvent(properties);
1701
1700
  };
1702
1701
  /**