Socket
Socket
Sign inDemoInstall

posthog-js

Package Overview
Dependencies
Maintainers
1
Versions
582
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthog-js - npm Package Compare versions

Comparing version 1.158.1 to 1.158.2

8

dist/lib/src/entrypoints/web-vitals.d.ts
declare const postHogWebVitalsCallbacks: {
onLCP: (onReport: (metric: import("web-vitals").LCPMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onCLS: (onReport: (metric: import("web-vitals").CLSMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onFCP: (onReport: (metric: import("web-vitals").FCPMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onINP: (onReport: (metric: import("web-vitals").INPMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onLCP: (onReport: (metric: import("web-vitals").LCPMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
onCLS: (onReport: (metric: import("web-vitals").CLSMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
onFCP: (onReport: (metric: import("web-vitals").FCPMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
onINP: (onReport: (metric: import("web-vitals").INPMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
};
export default postHogWebVitalsCallbacks;

@@ -9,2 +9,2 @@ import { NetworkRecordOptions, PostHogConfig } from '../../types';

*/
export declare const buildNetworkRequestOptions: (instanceConfig: PostHogConfig, remoteNetworkOptions: Pick<NetworkRecordOptions, 'recordHeaders' | 'recordBody' | 'recordPerformance' | 'payloadHostDenyList'>) => NetworkRecordOptions;
export declare const buildNetworkRequestOptions: (instanceConfig: PostHogConfig, remoteNetworkOptions: Pick<NetworkRecordOptions, "recordHeaders" | "recordBody" | "recordPerformance" | "payloadHostDenyList">) => NetworkRecordOptions;

@@ -43,3 +43,3 @@ import { PostHog } from '../posthog-core';

previewPageIndex: number;
forceDisableHtml?: boolean | undefined;
forceDisableHtml?: boolean;
}) => void;

@@ -49,3 +49,3 @@ export declare const renderFeedbackWidgetPreview: ({ survey, root, forceDisableHtml, }: {

root: HTMLElement;
forceDisableHtml?: boolean | undefined;
forceDisableHtml?: boolean;
}) => void;

@@ -52,0 +52,0 @@ export declare function generateSurveys(posthog: PostHog): SurveyManager | undefined;

declare const win: (Window & typeof globalThis) | undefined;
export declare const ArrayProto: any[];
export declare const nativeForEach: (callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any) => void;
export declare const nativeIndexOf: (searchElement: any, fromIndex?: number | undefined) => number;
export declare const nativeIndexOf: (searchElement: any, fromIndex?: number) => number;
export declare const navigator: Navigator | undefined;

@@ -12,7 +12,7 @@ export declare const document: Document | undefined;

prototype: XMLHttpRequest;
readonly DONE: number;
readonly HEADERS_RECEIVED: number;
readonly LOADING: number;
readonly OPENED: number;
readonly UNSENT: number;
readonly UNSENT: 0;
readonly OPENED: 1;
readonly HEADERS_RECEIVED: 2;
readonly LOADING: 3;
readonly DONE: 4;
} | undefined;

@@ -19,0 +19,0 @@ export declare const AbortController: {

export declare const logger: {
_log: (level: 'log' | 'warn' | 'error', ...args: any[]) => void;
_log: (level: "log" | "warn" | "error", ...args: any[]) => void;
info: (...args: any[]) => void;

@@ -4,0 +4,0 @@ warn: (...args: any[]) => void;

{
"name": "posthog-js",
"version": "1.158.1",
"version": "1.158.2",
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",

@@ -26,3 +26,5 @@ "repository": "https://github.com/PostHog/posthog-js",

"prepare": "husky install",
"deprecate-old-versions": "node scripts/deprecate-old-versions.mjs"
"deprecate-old-versions": "node scripts/deprecate-old-versions.mjs",
"check-testcafe-results": "ts-node testcafe/check-testcafe-results.js",
"run-testcafe-localhost": "node scripts/run-testcafe-localhost.mjs"
},

@@ -63,2 +65,3 @@ "main": "dist/main.js",

"@types/jest": "^29.5.1",
"@types/node": "^22.5.0",
"@types/react-dom": "^18.0.10",

@@ -68,4 +71,4 @@ "@types/sinon": "^17.0.1",

"@types/web": "^0.0.154",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"babel-eslint": "10.1.0",

@@ -77,7 +80,7 @@ "babel-jest": "^26.6.3",

"date-fns": "^3.6.0",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-posthog-js": "link:eslint-rules",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-compat": "^4.1.4",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-no-only-tests": "^3.1.0",

@@ -88,3 +91,4 @@ "eslint-plugin-posthog-js": "link:eslint-rules",

"eslint-plugin-react-hooks": "^4.6.0",
"express": "^4.18.2",
"expect": "^29.7.0",
"express": "^4.19.2",
"fast-check": "^2.17.0",

@@ -97,3 +101,3 @@ "husky": "^8.0.1",

"localStorage": "1.0.4",
"msw": "^1.2.1",
"msw": "^1.3.3",
"node-fetch": "^2.6.11",

@@ -112,3 +116,4 @@ "posthog-js": "link:",

"tslib": "^2.5.0",
"typescript": "^4.9.5",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"yargs": "^17.7.2"

@@ -115,0 +120,0 @@ },

@@ -88,3 +88,3 @@ import { find, includes } from './utils';

return !!find([
navigator === null || navigator === void 0 ? void 0 : navigator.doNotTrack,
navigator === null || navigator === void 0 ? void 0 : navigator.doNotTrack, // standard
navigator === null || navigator === void 0 ? void 0 : navigator['msDoNotTrack'],

@@ -91,0 +91,0 @@ assignableWindow['doNotTrack'],

@@ -160,6 +160,6 @@ var __assign = (this && this.__assign) || function () {

}
function getRequestPerformanceEntry(win, initiatorType, url, after, before, attempt) {
if (attempt === void 0) { attempt = 0; }
return __awaiter(this, void 0, void 0, function () {
function getRequestPerformanceEntry(win_1, initiatorType_1, url_1, after_1, before_1) {
return __awaiter(this, arguments, void 0, function (win, initiatorType, url, after, before, attempt) {
var urlPerformanceEntries, performanceEntry;
if (attempt === void 0) { attempt = 0; }
return __generator(this, function (_a) {

@@ -218,3 +218,3 @@ switch (_a.label) {

}
catch (e) {
catch (_c) {
return '[SessionReplay] Failed to stringify response object';

@@ -399,7 +399,7 @@ }

function _tryReadRequestBody(_a) {
var r = _a.r, options = _a.options, url = _a.url;
return __awaiter(this, void 0, void 0, function () {
var _b, hostname, isHostDenied;
return __generator(this, function (_c) {
_b = isHostOnDenyList(url, options), hostname = _b.hostname, isHostDenied = _b.isHostDenied;
return __awaiter(this, arguments, void 0, function (_b) {
var _c, hostname, isHostDenied;
var r = _b.r, options = _b.options, url = _b.url;
return __generator(this, function (_d) {
_c = isHostOnDenyList(url, options), hostname = _c.hostname, isHostDenied = _c.isHostDenied;
if (isHostDenied) {

@@ -413,6 +413,6 @@ return [2 /*return*/, Promise.resolve(hostname + ' is in deny list')];

function _tryReadResponseBody(_a) {
var r = _a.r, options = _a.options, url = _a.url;
return __awaiter(this, void 0, void 0, function () {
return __awaiter(this, arguments, void 0, function (_b) {
var cannotReadBodyReason;
return __generator(this, function (_b) {
var r = _b.r, options = _b.options, url = _b.url;
return __generator(this, function (_c) {
cannotReadBodyReason = _checkForCannotReadResponseBody({ r: r, options: options, url: url });

@@ -419,0 +419,0 @@ if (!isNull(cannotReadBodyReason)) {

declare const postHogWebVitalsCallbacks: {
onLCP: (onReport: (metric: import("web-vitals").LCPMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onCLS: (onReport: (metric: import("web-vitals").CLSMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onFCP: (onReport: (metric: import("web-vitals").FCPMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onINP: (onReport: (metric: import("web-vitals").INPMetric) => void, opts?: import("web-vitals").ReportOpts | undefined) => void;
onLCP: (onReport: (metric: import("web-vitals").LCPMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
onCLS: (onReport: (metric: import("web-vitals").CLSMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
onFCP: (onReport: (metric: import("web-vitals").FCPMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
onINP: (onReport: (metric: import("web-vitals").INPMetric) => void, opts?: import("web-vitals").ReportOpts) => void;
};
export default postHogWebVitalsCallbacks;

@@ -57,3 +57,3 @@ var __assign = (this && this.__assign) || function () {

}
catch (e) {
catch (_a) {
// no-empty

@@ -196,3 +196,3 @@ }

}
catch (_oO) {
catch (_c) {
// no-empty

@@ -199,0 +199,0 @@ }

@@ -12,3 +12,3 @@ import { isFunction, isNull, isObject, isUndefined } from '../../utils/type-utils';

}
catch (_e) {
catch (_a) {
return false;

@@ -15,0 +15,0 @@ }

@@ -9,2 +9,2 @@ import { NetworkRecordOptions, PostHogConfig } from '../../types';

*/
export declare const buildNetworkRequestOptions: (instanceConfig: PostHogConfig, remoteNetworkOptions: Pick<NetworkRecordOptions, 'recordHeaders' | 'recordBody' | 'recordPerformance' | 'payloadHostDenyList'>) => NetworkRecordOptions;
export declare const buildNetworkRequestOptions: (instanceConfig: PostHogConfig, remoteNetworkOptions: Pick<NetworkRecordOptions, "recordHeaders" | "recordBody" | "recordPerformance" | "payloadHostDenyList">) => NetworkRecordOptions;

@@ -835,2 +835,3 @@ var __assign = (this && this.__assign) || function () {

_batchKey: SESSION_RECORDING_BATCH_KEY,
skip_client_rate_limiting: true,
});

@@ -837,0 +838,0 @@ };

@@ -43,3 +43,3 @@ import { PostHog } from '../posthog-core';

previewPageIndex: number;
forceDisableHtml?: boolean | undefined;
forceDisableHtml?: boolean;
}) => void;

@@ -49,3 +49,3 @@ export declare const renderFeedbackWidgetPreview: ({ survey, root, forceDisableHtml, }: {

root: HTMLElement;
forceDisableHtml?: boolean | undefined;
forceDisableHtml?: boolean;
}) => void;

@@ -52,0 +52,0 @@ export declare function generateSurveys(posthog: PostHog): SurveyManager | undefined;

@@ -62,3 +62,3 @@ var __assign = (this && this.__assign) || function () {

}
catch (error) {
catch (_a) {
return false;

@@ -117,3 +117,3 @@ }

}
catch (e) {
catch (_b) {
return false;

@@ -120,0 +120,0 @@ }

@@ -107,3 +107,3 @@ var __assign = (this && this.__assign) || function () {

}
catch (e) {
catch (_b) {
// logger.error(e)

@@ -183,3 +183,3 @@ }

}
catch (e) {
catch (_c) {
// send beacon is a best-effort, fire-and-forget mechanism on page unload,

@@ -186,0 +186,0 @@ // we don't want to throw errors here

@@ -108,3 +108,3 @@ var __assign = (this && this.__assign) || function () {

}
catch (err) { }
catch (_a) { }
return null;

@@ -117,3 +117,3 @@ },

}
catch (err) {
catch (_a) {
// noop

@@ -152,3 +152,3 @@ }

}
catch (err) {
catch (_a) {
return;

@@ -161,3 +161,3 @@ }

}
catch (err) {
catch (_a) {
return;

@@ -183,3 +183,3 @@ }

}
catch (err) {
catch (_a) {
supported = false;

@@ -213,3 +213,3 @@ }

}
catch (err) {
catch (_a) {
// noop

@@ -247,3 +247,3 @@ }

}
catch (err) { }
catch (_a) { }
var value = extend(cookieProperties, JSON.parse(localStore.get(name) || '{}'));

@@ -253,3 +253,3 @@ localStore.set(name, value);

}
catch (err) {
catch (_b) {
// noop

@@ -325,3 +325,3 @@ }

}
catch (err) {
catch (_a) {
sessionStorageSupported = false;

@@ -351,3 +351,3 @@ }

}
catch (err) {
catch (_a) {
// noop

@@ -354,0 +354,0 @@ }

@@ -31,15 +31,15 @@ var __read = (this && this.__read) || function (o, n) {

'utm_term',
'gclid',
'gad_source',
'gclsrc',
'dclid',
'gbraid',
'wbraid',
'fbclid',
'msclkid',
'twclid',
'li_fat_id',
'mc_cid',
'igshid',
'ttclid',
'gclid', // google ads
'gad_source', // google ads
'gclsrc', // google ads 360
'dclid', // google display ads
'gbraid', // google ads, web to app
'wbraid', // google ads, app to web
'fbclid', // facebook
'msclkid', // microsoft
'twclid', // twitter
'li_fat_id', // linkedin
'mc_cid', // mailchimp campaign id
'igshid', // instagram
'ttclid', // tiktok
'rdt_cid', // reddit

@@ -46,0 +46,0 @@ ];

declare const win: (Window & typeof globalThis) | undefined;
export declare const ArrayProto: any[];
export declare const nativeForEach: (callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any) => void;
export declare const nativeIndexOf: (searchElement: any, fromIndex?: number | undefined) => number;
export declare const nativeIndexOf: (searchElement: any, fromIndex?: number) => number;
export declare const navigator: Navigator | undefined;

@@ -12,7 +12,7 @@ export declare const document: Document | undefined;

prototype: XMLHttpRequest;
readonly DONE: number;
readonly HEADERS_RECEIVED: number;
readonly LOADING: number;
readonly OPENED: number;
readonly UNSENT: number;
readonly UNSENT: 0;
readonly OPENED: 1;
readonly HEADERS_RECEIVED: 2;
readonly LOADING: 3;
readonly DONE: 4;
} | undefined;

@@ -19,0 +19,0 @@ export declare const AbortController: {

@@ -124,3 +124,3 @@ var __values = (this && this.__values) || function(o) {

}
catch (error) {
catch (_a) {
return false;

@@ -142,3 +142,3 @@ }

}
catch (e) {
catch (_a) {
return undefined;

@@ -164,3 +164,3 @@ }

};
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export var safewrapClass = function (klass, functions) {

@@ -167,0 +167,0 @@ for (var i = 0; i < functions.length; i++) {

export declare const logger: {
_log: (level: 'log' | 'warn' | 'error', ...args: any[]) => void;
_log: (level: "log" | "warn" | "error", ...args: any[]) => void;
info: (...args: any[]) => void;

@@ -4,0 +4,0 @@ warn: (...args: any[]) => void;

@@ -22,3 +22,7 @@ import { document } from '../utils/globals';

get: function () {
return this.instance.config.api_host.trim().replace(/\/$/, '');
var host = this.instance.config.api_host.trim().replace(/\/$/, '');
if (host === 'https://app.posthog.com') {
return 'https://us.i.posthog.com';
}
return host;
},

@@ -32,2 +36,7 @@ enumerable: false,

var host = (_a = this.instance.config.ui_host) === null || _a === void 0 ? void 0 : _a.replace(/\/$/, '');
if (!host) {
// No ui_host set, get it from the api_host. But api_host differs
// from the actual UI host, so replace the ingestion subdomain with just posthog.com
host = this.apiHost.replace(".".concat(ingestionDomain), '.posthog.com');
}
if (host === 'https://app.posthog.com') {

@@ -66,3 +75,3 @@ return 'https://us.posthog.com';

if (target === 'ui') {
return (this.uiHost || this.apiHost.replace(".".concat(ingestionDomain), '.posthog.com')) + path;
return this.uiHost + path;
}

@@ -69,0 +78,0 @@ if (this.region === RequestRouterRegion.CUSTOM) {

@@ -61,3 +61,3 @@ import { each, isValidRegex } from './';

}
catch (err) {
catch (_a) {
logger.error('Skipping decoding for malformed query param: ' + result);

@@ -64,0 +64,0 @@ }

{
"name": "posthog-js",
"version": "1.158.1",
"version": "1.158.2",
"description": "Posthog-js allows you to automatically capture usage and send events to PostHog.",

@@ -26,3 +26,5 @@ "repository": "https://github.com/PostHog/posthog-js",

"prepare": "husky install",
"deprecate-old-versions": "node scripts/deprecate-old-versions.mjs"
"deprecate-old-versions": "node scripts/deprecate-old-versions.mjs",
"check-testcafe-results": "ts-node testcafe/check-testcafe-results.js",
"run-testcafe-localhost": "node scripts/run-testcafe-localhost.mjs"
},

@@ -63,2 +65,3 @@ "main": "dist/main.js",

"@types/jest": "^29.5.1",
"@types/node": "^22.5.0",
"@types/react-dom": "^18.0.10",

@@ -68,4 +71,4 @@ "@types/sinon": "^17.0.1",

"@types/web": "^0.0.154",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"babel-eslint": "10.1.0",

@@ -77,7 +80,7 @@ "babel-jest": "^26.6.3",

"date-fns": "^3.6.0",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-posthog-js": "link:eslint-rules",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-compat": "^4.1.4",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-no-only-tests": "^3.1.0",

@@ -88,3 +91,4 @@ "eslint-plugin-posthog-js": "link:eslint-rules",

"eslint-plugin-react-hooks": "^4.6.0",
"express": "^4.18.2",
"expect": "^29.7.0",
"express": "^4.19.2",
"fast-check": "^2.17.0",

@@ -97,3 +101,3 @@ "husky": "^8.0.1",

"localStorage": "1.0.4",
"msw": "^1.2.1",
"msw": "^1.3.3",
"node-fetch": "^2.6.11",

@@ -112,3 +116,4 @@ "posthog-js": "link:",

"tslib": "^2.5.0",
"typescript": "^4.9.5",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"yargs": "^17.7.2"

@@ -115,0 +120,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc