Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

11.8 KB
Raw Blame
{
    "name": "@posthog/nodejs",
    "version": "1.10.5",
    "description": "PostHog Node.js services",
    "license": "MIT",
    "author": "PostHog <[email protected]>",
    "repository": "https://github.com/PostHog/posthog",
    "main": "dist/index.js",
    "types": "dist/index.d.ts",
    "scripts": {
        "test": "pnpm test:parallel; parallel_status=$?; pnpm test:serial; serial_status=$?; exit $((parallel_status || serial_status))",
        "test:serial": "SHARD_IDX=${SHARD_INDEX:-1}; SHARD_TOTAL=${SHARD_COUNT:-1}; echo serial $SHARD_IDX/$SHARD_TOTAL; JEST_JUNIT_OUTPUT_NAME=${JEST_JUNIT_OUTPUT_NAME%.xml}-serial.xml jest --config jest.serial.config.js --runInBand --forceExit --shard=$SHARD_IDX/$SHARD_TOTAL --testPathIgnorePatterns='postgres-parity|service-e2e|<rootDir>/(src|tests)(/.*)?/dev/'",
        "test:parallel": "SHARD_IDX=${SHARD_INDEX:-1}; SHARD_TOTAL=${SHARD_COUNT:-1}; echo parallel $SHARD_IDX/$SHARD_TOTAL; JEST_JUNIT_OUTPUT_NAME=${JEST_JUNIT_OUTPUT_NAME%.xml}-parallel.xml jest --config jest.config.js --maxWorkers=4 --passWithNoTests --forceExit --shard=$SHARD_IDX/$SHARD_TOTAL --testPathIgnorePatterns='postgres-parity|service-e2e|<rootDir>/(src|tests)(/.*)?/dev/'",
        "test:rust-ingestion-e2e": "if [ -f tests/service-e2e/rust-ingestion-consumer.serial.test.ts ]; then jest --config jest.serial.config.js --runInBand --forceExit --testPathPatterns='service-e2e/rust-ingestion-consumer.serial.test.ts'; else jest --runInBand --forceExit --testPathPatterns='service-e2e/rust-ingestion-consumer.test.ts'; fi",
        "test:personhog-kafka-parity-e2e": "jest --config jest.serial.config.js --runInBand --forceExit --testPathPatterns='service-e2e/personhog-kafka-parity.serial.test.ts'",
        "test:postgres-parity": "jest --runInBand --forceExit --testPathPatterns='postgres-parity'",
        "start": "pnpm start:dev",
        "start:dist": "node dist/index.js",
        "start:dev": "NODE_ENV=dev tsx watch src/index.ts",
        "start:devNoWatch": "NODE_ENV=dev tsx src/index.ts",
        "build": "pnpm clean && pnpm typescript:compile && pnpm typescript:compile-cleanup",
        "clean": "rm -rf dist/*",
        "typescript:compile": "tsc -b && tsc-alias",
        "typescript:compile-cleanup": "[ -d dist/src ] && mv dist/src/* dist/ || true",
        "typescript:check": "tsc --noEmit -p .",
        "typescript:check:tsgo": "tsgo --noEmit -p .",
        "lint": "eslint . && oxlint -c .oxlintrc.nodejs.json .",
        "lint:fix": "eslint . --fix && oxlint -c .oxlintrc.nodejs.json . --fix",
        "check:boundaries": "node bin/check-ingestion-boundaries.mjs",
        "check:boundaries:write": "node bin/check-ingestion-boundaries.mjs --write",
        "build:filter-globals": "pnpm --filter=@posthog/hogvm build && NODE_ENV=test tsx bin/build-filter-globals.ts",
        "format": "prettier --write .",
        "format:check": "prettier --check .",
        "prepublishOnly": "pnpm build",
        "setup:dev:clickhouse": "cd .. && DEBUG=1 python manage.py migrate_clickhouse",
        "setup:test": "cd .. && TEST=1 python manage.py setup_test_environment && cd nodejs && pnpm run setup:test:rust",
        "test:full": "docker compose -f ../docker-compose.dev.yml --profile dynamodb up -d && pnpm setup:test && pnpm test && pnpm test:postgres-parity && pnpm test:rust-ingestion-e2e",
        "setup:test:rust": "CYCLOTRON_NODE_DATABASE_NAME=test_cyclotron_node PERSONS_DATABASE_NAME=test_persons BEHAVIORAL_COHORTS_DATABASE_NAME=test_behavioral_cohorts ../rust/bin/migrate-entry all --fresh",
        "setup:test:persons-parity": "PERSONS_DATABASE_NAME=test_persons_parity ../rust/bin/migrate-entry persons --fresh",
        "migrate:persons": "../rust/bin/migrate-persons",
        "migrate:cyclotron-node": "../rust/bin/migrate-cyclotron-node",
        "migrate:behavioral-cohorts": "../rust/bin/migrate-behavioral-cohorts",
        "migrate:rust": "../rust/bin/migrate-entry all",
        "services:start": "cd .. && docker compose -f docker-compose.dev.yml --profile dynamodb up",
        "services:stop": "cd .. && docker compose -f docker-compose.dev.yml down",
        "services:clean": "cd .. && docker compose -f docker-compose.dev.yml rm -v",
        "services": "pnpm services:stop && pnpm services:clean && pnpm services:start",
        "build:hogvm-node": "pnpm --filter=@posthog/hogvm-node build",
        "build:hogvm-node:dev": "pnpm --filter=@posthog/hogvm-node run build:dev",
        "build:replay-anonymizer": "pnpm --filter=@posthog/replay-anonymizer package",
        "build:replay-anonymizer:dev": "pnpm --filter=@posthog/replay-anonymizer run build:dev",
        "build:ai-research-v4-native": "pnpm --filter=@posthog/ai-research-v4-native package",
        "build:ai-research-v4-native:dev": "pnpm --filter=@posthog/ai-research-v4-native run build:dev",
        "generate:personhog-proto": "cd ../proto && buf generate --template ../nodejs/buf.gen.yaml --path personhog/service --path personhog/identity --path personhog/lifecycle --path personhog/types . && cd ../nodejs && eslint --fix src/common/generated/personhog && oxlint -c .oxlintrc.nodejs.json --fix src/common/generated/personhog && prettier --write src/common/generated/personhog",
        "generate:ingestion-worker-proto": "cd ../proto && buf generate --template ../nodejs/buf.gen.ingestion-worker.yaml --path ingestion/worker . && cd ../nodejs && eslint --fix src/common/generated/ingestion-worker && oxlint -c .oxlintrc.nodejs.json --fix src/common/generated/ingestion-worker && prettier --write src/common/generated/ingestion-worker",
        "generate:usage-ingestion-proto": "cd ../proto && buf generate --template ../nodejs/buf.gen.usage-ingestion.yaml --path usage_ingestion . && cd ../nodejs && eslint --fix src/common/generated/usage-ingestion && oxlint -c .oxlintrc.nodejs.json --fix src/common/generated/usage-ingestion && prettier --write src/common/generated/usage-ingestion",
        "update-ai-costs": "ts-node src/ingestion/pipelines/ai/costs/scripts/update-ai-costs.ts",
        "gen:ingestion-warning-types": "ts-node src/ingestion/common/scripts/generate-ingestion-warning-types.ts",
        "sync-segment-icons": "DATABASE_URL=something ts-node src/cdp/segment/sync-segment-icons.ts",
        "start:recording-rasterizer": "node dist/session-replay/recording-rasterizer/index.js"
    },
    "dependencies": {
        "@amplitude/ua-parser-js": "^0.7.33",
        "@aws-sdk/client-dynamodb": "^3.952.0",
        "@aws-sdk/client-kms": "^3.952.0",
        "@aws-sdk/client-s3": "^3.723.0",
        "@aws-sdk/client-sesv2": "^3.980.0",
        "@aws-sdk/client-sts": "^3.975.0",
        "@aws-sdk/credential-provider-node": "^3.972.1",
        "@aws-sdk/lib-storage": "^3.723.0",
        "@babel/core": "^7.26.10",
        "@babel/plugin-transform-react-jsx": "^7.22.5",
        "@babel/preset-env": "^7.22.10",
        "@babel/preset-typescript": "^7.18.6",
        "@babel/standalone": "^7.23.2",
        "@bufbuild/protobuf": "^2.11.0",
        "@clickhouse/client": "^1.12.0",
        "@connectrpc/connect": "^2.1.1",
        "@connectrpc/connect-node": "^2.1.1",
        "@dsnp/parquetjs": "^1.8.7",
        "@google-cloud/pubsub": "4.11.0",
        "@google-cloud/storage": "^5.8.5",
        "@maxmind/geoip2-node": "^3.4.0",
        "@mongodb-js/zstd": "^7.0.0",
        "@opentelemetry/api": "^1.9.0",
        "@opentelemetry/auto-instrumentations-node": "^0.76.0",
        "@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
        "@opentelemetry/exporter-trace-otlp-grpc": "^0.218.0",
        "@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
        "@opentelemetry/instrumentation-pg": "^0.70.0",
        "@opentelemetry/resources": "^2.0.1",
        "@opentelemetry/sdk-metrics": "^2.7.1",
        "@opentelemetry/sdk-node": "^0.218.0",
        "@opentelemetry/sdk-trace-node": "^2.0.1",
        "@opentelemetry/semantic-conventions": "^1.36.0",
        "@posthog/ai-research-v4-native": "workspace:*",
        "@posthog/hogvm": "workspace:*",
        "@posthog/hogvm-node": "workspace:*",
        "@posthog/replay-anonymizer": "workspace:*",
        "@posthog/replay-headless": "workspace:*",
        "@posthog/siphash": "1.1.1",
        "@pyroscope/nodejs": "^0.5.0",
        "@segment/action-destinations": "3.387.0",
        "@smithy/node-http-handler": "4.4.9",
        "@temporalio/activity": "1.15.0",
        "@temporalio/client": "1.15.0",
        "@temporalio/common": "1.15.0",
        "@temporalio/proto": "1.15.0",
        "@temporalio/worker": "1.15.0",
        "@temporalio/workflow": "1.15.0",
        "@trybyte/robotstxt-parser": "^1.2.0",
        "@types/node": "catalog:",
        "@types/tail": "^2.2.1",
        "avsc": "^5.7.9",
        "aws-sdk": "^2.927.0",
        "cors": "^2.8.5",
        "detect-browser": "^5.3.0",
        "escape-string-regexp": "^4.0.0",
        "fast-equals": "catalog:",
        "fastpriorityqueue": "^0.7.5",
        "fernet-nodejs": "^1.0.6",
        "generic-pool": "^3.7.1",
        "https-proxy-agent": "^7.0.6",
        "husky": "catalog:",
        "ioredis": "^4.27.6",
        "ipaddr.js": "^2.1.0",
        "js-big-decimal": "^2.2.0",
        "jsonwebtoken": "^9.0.2",
        "libsodium-wrappers": "^0.7.15",
        "liquidjs": "^10.27.2",
        "lodash": "^4.18.1",
        "lru-cache": "^11.0.0",
        "luxon": "^3.4.4",
        "lz4": "^0.6.5",
        "node-fetch": "^2.6.1",
        "node-rdkafka": "^3.6.1",
        "node-schedule": "^2.1.0",
        "nodemailer": "^8.0.8",
        "p-limit": "3.1.0",
        "pg": "^8.6.0",
        "pino": "^8.6.0",
        "posthog-node": "5.61.2",
        "pretty-bytes": "^5.6.0",
        "prom-client": "^14.2.0",
        "puppeteer": "^24.3.0",
        "puppeteer-capture": "^1.43.0",
        "re2": "^1.26.1",
        "snappy": "^7.2.2",
        "structured-headers": "^2.0.3",
        "tail": "^2.2.6",
        "tldts": "^6.1.57",
        "typescript": "catalog:",
        "uWebSockets.js": "https://codeload.github.com/uNetworking/uWebSockets.js/tar.gz/e0f56ebb4b349017f006e14d1cd29052f2a7121d",
        "ultimate-express": "2.0.9",
        "undici": "^8.10.1",
        "undici-types": "7.3.0",
        "uuid": "^11.1.1",
        "xml-js": "^1.6.11",
        "zod": "^4.3.6"
    },
    "devDependencies": {
        "@babel/cli": "^7.22.5",
        "@babel/types": "^7.20.2",
        "@bufbuild/protoc-gen-es": "^2.11.0",
        "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
        "@segment/actions-core": "^3.151.0",
        "@trivago/prettier-plugin-sort-imports": "^5.2.2",
        "@types/adm-zip": "^0.4.34",
        "@types/babel__core": "^7.1.19",
        "@types/babel__standalone": "^7.1.4",
        "@types/chance": "^1.1.7",
        "@types/cors": "^2.8.19",
        "@types/faker": "^5.5.7",
        "@types/ioredis": "^4.26.4",
        "@types/jest": "^30.0.0",
        "@types/jsonwebtoken": "^9.0.10",
        "@types/libsodium-wrappers": "^0.7.14",
        "@types/lodash": "^4.17.16",
        "@types/long": "4.x.x",
        "@types/luxon": "^3.4.2",
        "@types/node-fetch": "^2.5.10",
        "@types/node-schedule": "^2.1.0",
        "@types/nodemailer": "^8.0.0",
        "@types/pg": "~8.6.6",
        "@jest/test-sequencer": "^30.0.5",
        "@types/redlock": "^4.0.1",
        "@types/snowflake-sdk": "^1.5.1",
        "@types/supertest": "^6.0.2",
        "@typescript-eslint/eslint-plugin": "^8.58.2",
        "@typescript-eslint/parser": "^8.58.2",
        "chance": "^1.1.13",
        "eslint": "^8.57.0",
        "eslint-plugin-no-only-tests": "^3.1.0",
        "jest": "^30.0.0",
        "jest-environment-node": "^30.0.0",
        "jest-junit": "^16.0.0",
        "oxlint": "1.72.0",
        "oxlint-plugin-eslint": "1.72.0",
        "oxlint-tsgolint": "7.0.2001",
        "pino-pretty": "^9.1.0",
        "prettier": "~3.6.2",
        "supertest": "^7.2.2",
        "ts-jest": "^29.4.9",
        "ts-node": "^10.9.1",
        "tsc-alias": "^1.8.16",
        "tsconfig-paths": "^4.2.0",
        "tsx": "^4.7.0"
    },
    "engines": {
        "node": ">=26 <27"
    }
}