mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-11-03 00:53:53 +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
Insights State Management Logging Examples
This is a comparison of Insights logging integrations with different state management libraries using a todo list application built with Next.js.
Examples Included
- Redux: Uses Redux Toolkit with
insightsReduxLoggermiddleware - Kea: Uses Kea with
insightsKeaLoggerplugin (cleaner API)
To run it
pnpm i && pnpm dev
Then visit:
- Home: http://localhost:3000/ - Overview and links to examples
- Redux: http://localhost:3000/redux - Redux Toolkit + Insights logging
- Kea: http://localhost:3000/kea - Kea + Insights logging
Features Demonstrated
- Action and state logging with Insights
- Rate limiting to prevent log flooding
- State diffing (only log changed values)
- Action/state masking for sensitive data
- Performance monitoring (slow action detection)
- Different API styles (Redux-specific vs generic)
Apologies to the future traveller, the example todo app is entirely AI slop