{ "name": "posthog-js", "version": "1.456.2", "bugs": { "url": "https://github.com/PostHog/posthog-js/issues" }, "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", "repository": "https://github.com/PostHog/posthog-js", "author": "engineering@posthog.com", "license": "(Apache-2.0 AND MIT)", "homepage": "https://posthog.com/docs/libraries/js", "packageManager": "pnpm@10.33.0", "scripts": { "check-types": "pnpm typecheck && pnpm test:typecheck", "clean": "rimraf lib dist react/dist", "start": "pnpm dev", "dev": "tsc -b && NODE_OPTIONS=\"--max-old-space-size=8192\" pnpm --filter=posthog-js run --parallel \"/^dev:/\"", "dev:compile": "tsc -b --watch", "dev:runtime": "pnpm build:runtime --watch", "dev:types": "pnpm build:types --watch", "build": "tsc -b && pnpm build:runtime && node scripts/embed-extension-integrity.mjs && node scripts/generate-integrity-manifest.mjs && pnpm build:types", "build:runtime": "rolldown -c rollup.config.mjs", "build:types": "BUILD_TYPES_ONLY=1 rolldown -c rollup.config.mjs", "bundle-size:array": "node scripts/compare-array-bundle-size.mjs", "benchmark:replay": "node scripts/benchmark-replay.mjs", "postbuild": "node scripts/strip-lib-package-json.js && node scripts/check-mangled-property-consistency.js && node scripts/check-sourcemap-ignore-list.js", "prepack": "node scripts/strip-sourcemap-sources-content.js", "package": "pnpm pack --out $PACKAGE_DEST/%s.tgz", "lint": "oxlint --report-unused-disable-directives-severity error src && oxlint --report-unused-disable-directives-severity error playwright", "lint:fix": "oxlint --report-unused-disable-directives-severity error src --fix && oxlint --report-unused-disable-directives-severity error playwright --fix", "format": "oxfmt --write src/ functional_tests/ playwright/", "format:check": "oxfmt --check src/ functional_tests/ playwright/", "prepublishOnly": "pnpm check-react", "check-react": "[ -d 'react/dist' ] || { echo '@posthog/react has not been built'; exit 1; }", "test": "pnpm test:unit && pnpm test:functional", "test:unit": "vitest run src", "test:unit:surveys": "vitest run survey", "test:unit:tours": "vitest run tours", "test:functional": "POSTHOG_FUNCTIONAL_TESTS=1 vitest run functional_tests", "test-watch": "vitest src", "test:typecheck": "cd src/__tests__ && tsc --noEmit --project tsconfig.json", "typecheck": "tsc --noEmit --project tsconfig.json", "playwright": "pnpm exec playwright test --project webkit --project firefox --project chromium", "playwright:compat": "pnpm exec playwright test --config playwright.config.compat.ts", "playwright:integration": "pnpm exec playwright test --config playwright.config.integration.ts --project webkit --project firefox --project chromium", "playwright-ui": "pnpm exec playwright test --ui --project webkit --project firefox --project chromium", "playwright-webserver": "npx http-server ./ -p 2345", "playwright:surveys": "pnpm exec playwright test packages/browser/playwright/mocked/surveys/* --project webkit --project firefox --project chromium", "playwright:surveys:ui": "pnpm exec playwright test packages/browser/playwright/mocked/surveys/* --ui --project webkit --project firefox --project chromium", "playwright:tours:ui": "pnpm exec playwright test packages/browser/playwright/mocked/product-tours/* --ui --project webkit --project firefox --project chromium", "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", "write-mangled-property-names": "WRITE_MANGLED_PROPERTIES=1 pnpm build", "compatibility:test": "node playwright/compatibility/cli.mjs check", "compatibility:update": "node playwright/compatibility/cli.mjs update", "compatibility:self-test": "node --test playwright/compatibility/*.test.mjs", "compatibility:controls": "node playwright/compatibility/negative-control.mjs" }, "main": "dist/main.js", "module": "dist/module.mjs", "types": "dist/module.d.ts", "files": [ "lib/*", "dist/*", "test-fixtures/*.json", "react/dist/**", "react/package.json", "react/surveys/package.json", "react/slim/package.json", "full/package.json", "full/no-external/package.json", "no-external/package.json", "customizations/package.json", "rrweb/package.json", "rrweb-types/package.json", "rrweb-plugin-console-record/package.json" ], "dependencies": { "@posthog/browser-common": "workspace:^", "@posthog/core": "workspace:^", "@posthog/types": "workspace:^", "core-js": "^3.49.0", "dompurify": "^3.4.18", "fflate": "^0.4.8", "preact": "^10.29.3", "query-selector-shadow-dom": "^1.0.1", "web-vitals": "^6.2.1", "web-vitals-soft-navs": "npm:web-vitals@6.2.1" }, "peerDependencies": { "@types/react": ">=16.8.0", "react": ">=16.8.0" }, "peerDependenciesMeta": { "@types/react": { "optional": true }, "react": { "optional": true } }, "devDependencies": { "@babel/core": "catalog:", "@babel/plugin-syntax-decorators": "catalog:", "@babel/plugin-transform-exponentiation-operator": "catalog:", "@babel/plugin-transform-nullish-coalescing-operator": "catalog:", "@babel/plugin-transform-react-jsx": "catalog:", "@babel/preset-env": "catalog:", "@babel/preset-typescript": "catalog:", "@jridgewell/sourcemap-codec": "^1.5.5", "@playwright/test": "1.52.0", "@posthog-tooling/rollup-utils": "workspace:*", "@posthog-tooling/sdk-mock-server": "workspace:*", "@posthog/rrweb": "workspace:*", "@posthog/rrweb-plugin-console-record": "workspace:*", "@posthog/rrweb-record": "workspace:*", "@posthog/rrweb-types": "workspace:*", "@posthog/rrweb-utils": "workspace:*", "@rollup/plugin-babel": "^6.0.4", "@sentry/types": "8.7.0", "@testing-library/dom": "catalog:", "@testing-library/jest-dom": "catalog:", "@testing-library/preact": "catalog:", "@types/dompurify": "^3.2.0", "@types/dotenv": "^8.2.3", "@types/node": "^22.5.0", "@types/query-selector-shadow-dom": "^1.0.4", "@types/sinon": "^17.0.1", "@types/web": "^0.0.222", "browserslist": "^4.28.8", "compare-versions": "^6.1.1", "date-fns": "^3.6.0", "dotenv": "^17.4.2", "esbuild": "^0.25.0", "expect": "^29.7.0", "fast-check": "^2.17.0", "http-server": "14.1.1", "identity-obj-proxy": "^3.0.0", "jsdom": "16.7.0", "jsdom-global": "3.0.2", "lightningcss": "^1.33.0", "localStorage": "1.0.4", "msw": "^1.3.3", "node-fetch": "^2.6.11", "posthog-js": "link:", "preact-render-to-string": "^6.3.1", "rolldown": "catalog:", "rolldown-plugin-dts": "catalog:", "rollup-plugin-visualizer": "^6.0.3", "sinon": "9.0.2", "testcafe": "^2.6.2", "testcafe-browser-provider-browserstack": "^1.15.2", "terser": "catalog:", "ts-node": "^10.9.2", "tslib": "catalog:", "typescript": "catalog:", "yargs": "^17.7.2", "vitest": "catalog:" }, "browserslist": [ "> 0.5%, last 2 versions, Firefox ESR, not dead" ] }