mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
Bulk rename across 989 files: - Package names: posthog-js → @hanzo/insights, posthog-node → @hanzo/insights-node, etc. - Repository URLs: posthog/posthog-js → hanzoai/insights-js - Brand names: PostHog → Insights - File renames: 259 reference JSON files, source files, workflow files - Directory rename: eslint-plugin-posthog-js → eslint-plugin-insights Remaining: 8 refs to @posthog/rrweb-* (real npm deps, need fork+publish)
1.5 KiB
1.5 KiB
Insights VS Code Extension Playground
This is a playground to test Insights integration within a VS Code extension's webview.
How to run
- Open this directory (
packages/browser/playground/vscode-extension) in a separate VS Code window. - Open a terminal and run
pnpm install. - Press
F5to open a new Extension Development Host window. - In the new window, open the Command Palette (
Cmd+Shift+PorCtrl+Shift+P) and search for "Start Insights Playground". - Run the command to open the webview.
- You can interact with the input and button to send events to Insights.
Configuration
Running with a local @hanzo/insights build
By default, the playground is configured to use a local build of @hanzo/insights. In src/extension.js, the runningLocally constant is set to true. This will load array.full.js from the packages/browser/dist directory.
To use the production snippet from the Insights CDN, you will need to set runningLocally to false.
Environment Variables
The Insights project key and API host are loaded from a .env file in the root of the @hanzo/insights repository.
- If you don't already have one, create a
.envfile at the root of the@hanzo/insightsproject. - Add your Insights Project Key to the
.envfile:IfINSIGHTS_PROJECT_API_KEY=<your-project-key> INSIGHTS_API_HOST=<your-api-host>INSIGHTS_API_HOSTis not set, it will default tohttp://localhost:8010.