mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
# Conflicts: # .github/workflows/check-insights-major-version.yml # .github/workflows/check-posthog-major-version.yml # .github/workflows/ci-security.yaml # .github/workflows/validate-versioning.yml # AGENTS.md # AGENTS.md~upstream_main # packages/ai/src/otel/capture.ts # packages/ai/src/otel/mappers/aiSdk.ts # packages/ai/src/otel/mappers/index.ts # packages/ai/src/otel/types.ts # packages/core/src/__tests__/posthog.init.spec.ts # packages/react-native/src/PostHogProvider.tsx # packages/react/src/context/PostHogContext.ts # packages/react/src/context/PostHogProvider.tsx # tooling/eslint-plugin-insights/no-unsafe-web-global.js
Getting started
Requirements
# Install Insights CLI globally
cargo install insights-cli
From the project root directory:
# Install deps
pnpm install
# Build local version of @hanzo/insights
pnpm run build-insights
Sourcemaps management
Commands to test sourcemap upload:
# Generate build artifacts and use insights-cli to inject snippets into sources and sourcemaps
VITE_INSIGHTS_KEY='<your-project-key>' VITE_INSIGHTS_HOST='http://localhost:8010' pnpm run build
# For NextJS based app use
NEXT_PUBLIC_INSIGHTS_KEY='<your-project-key>' NEXT_PUBLIC_INSIGHTS_HOST='http://localhost:8010' pnpm run build
# Use insights-cli to inject snippets into sources and sourcemaps
pnpm run inject
# Upload sourcemaps to Insights
pnpm run upload
# Run application locally with newly generated minified build and sourcemaps
# Start sending exceptions to Insights
pnpm run preview