mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
One family. Font stacks name Zen and fall back to the native faces, tokens name the role rather than a face, and the packages that used to supply a face now point at @hanzo/font. Self-hosted @font-face blocks are removed rather than renamed: rewriting the family in one would leave a src pointing at a file this repo no longer ships. @hanzo/font carries the binaries and declares the faces, so the local copies go with the declaration that used them. Comments naming a face we no longer use are deleted, not reworded.
SDK Doctor Test Examples
Test Files
test-time-based-detection.html
Tests SDK Doctor's ability to detect outdated SDK versions using time-based logic across all supported SDKs (Web, Python, Node.js, React Native, Flutter, iOS, Android, Go, PHP, Ruby, Elixir, .NET).
- Fetches current release/version info from GitHub
- Sends events to tests "Current", "Close enough", and "Outdated" detection
test-feature-flag-misconfiguration.html
Sends events to tests SDK Doctor's ability to detect feature flags called events captured prior to any other events in the same session
- Tests flags called before any other events (problematic)
- Tests multiple flags before any other events (problematic)
- Tests proper flag usage after any other events (correct)
- Does not alert for bootstrapped flags
Usage
-
Configure your Insights API key:
- Open the HTML file in a text editor
- Find the
API_KEYconstant near the top of the<script>section - Replace
'YOUR_INSIGHTS_PROJECT_API_KEY'with your Insights project API key (phc_...) - Update the
HOSTvalue with your Insights instance URL (e.g.,http://localhost:8010)
-
Open the HTML file in your web browser (Chrome, Firefox, Safari, etc.)
-
Run tests:
- Click any test button to simulate different scenarios
- Watch the log output for event details
- Open your Insights instance's activity page to see the events sent.
Requirements
- A text editor
- A web browser (no build tools or dependencies needed)
- A Insights instance (local/dev or self-hosted)
- A Insights project API key
- A tolerance for vibe-coded stuff
Development
These are basic, standalone HTML files with embedded CSS and JavaScript. To modify:
- Open the HTML file in your favorite text editor (or your least favorite, if you're in the mood for a challenge)
- Make changes to the HTML, CSS, or JavaScript
- Refresh in browser to test. No build step needed.