UNPKG

posthog-js

Version:

Posthog-js allows you to automatically capture usage and send events to PostHog.

165 lines • 7.23 kB
{ "name": "posthog-js", "version": "1.438.23", "bugs": { "url": "https://github.com/PostHog/posthog-js/issues" }, "description": "Posthog-js allows you to automatically capture usage and send events to PostHog.", "repository": { "type": "git", "url": "https://github.com/PostHog/posthog-js" }, "author": "engineering@posthog.com", "license": "(Apache-2.0 AND MIT)", "homepage": "https://posthog.com/docs/libraries/js", "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": { "core-js": "^3.49.0", "dompurify": "^3.4.13", "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", "@posthog/core": "^1.60.1", "@posthog/types": "^1.416.1", "@posthog/browser-common": "^0.9.11" }, "peerDependencies": { "@types/react": ">=16.8.0", "react": ">=16.8.0" }, "peerDependenciesMeta": { "@types/react": { "optional": true }, "react": { "optional": true } }, "devDependencies": { "@babel/core": "^7.27.1", "@babel/plugin-syntax-decorators": "^7.27.1", "@babel/plugin-transform-exponentiation-operator": "^7.27.1", "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1", "@babel/plugin-transform-react-jsx": "^7.27.1", "@babel/preset-env": "^7.27.1", "@babel/preset-typescript": "^7.27.1", "@jridgewell/sourcemap-codec": "^1.5.5", "@playwright/test": "1.52.0", "@rollup/plugin-babel": "^6.0.4", "@sentry/types": "8.7.0", "@testing-library/dom": "^10.4.1", "@testing-library/jest-dom": "^6.9.1", "@testing-library/preact": "^3.2.4", "@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": "1.2.4", "rolldown-plugin-dts": "0.27.14", "rollup-plugin-visualizer": "^6.0.3", "sinon": "9.0.2", "testcafe": "^2.6.2", "testcafe-browser-provider-browserstack": "^1.15.2", "terser": "5.48.0", "ts-node": "^10.9.2", "tslib": "^2.5.0", "typescript": "5.8.2", "yargs": "^17.7.2", "vitest": "^1.6.1", "@posthog-tooling/rollup-utils": "1.1.1", "@posthog-tooling/sdk-mock-server": "0.0.0", "@posthog/rrweb": "0.1.8", "@posthog/rrweb-plugin-console-record": "1.0.8", "@posthog/rrweb-utils": "0.0.65", "@posthog/rrweb-record": "0.0.88", "@posthog/rrweb-types": "0.0.62" }, "browserslist": [ "> 0.5%, last 2 versions, Firefox ESR, not dead" ], "scripts": { "check-types": "pnpm 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 && 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", "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/", "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", "generate-references": "pnpm exec api-extractor run --config ./api-extractor.json --local && node scripts/generate-docs.js", "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" } }