mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
A version written into a manifest is written into every manifest that wants it, which is how eslint came to exist in a hundred and four forms across this estate and how a package came to resolve twice at run time. The catalog moves the number out of the manifest: a manifest names the package, the workspace names the version. Four are held below their latest because the newer release cannot be used, and the reason is recorded rather than the version alone: @noble/hashes 2 renamed every subpath the web3 stack imports, @splinetool/runtime 2 depends on a package that was never published, @dynamic-labs 5.4.1 the same, and react-resizable-panels 3 points its types condition at the bundle.
@insights/next App Router Example
A Next.js 15 App Router example demonstrating all features of the @insights/next package.
Setup
-
Copy the environment template:
cp .env.local.example .env.local -
Add your Insights API key to
.env.local:NEXT_PUBLIC_INSIGHTS_KEY=phc_your_key_here NEXT_PUBLIC_INSIGHTS_HOST=https://us.i.insights.com -
From the monorepo root, export packages as tarballs:
pnpm package:watch -
In a new terminal, install dependencies and start the dev server from this directory:
pnpm install pnpm dev
Demos
| Route | Feature | Description |
|---|---|---|
/auth |
Identity | Log in/out with insights.identify() and insights.reset() |
/server-flags |
Server Components | Evaluate feature flags server-side |
/client-hooks |
React Hooks | Use useFeatureFlag and friends |
/ssr-bootstrap |
SSR Bootstrap | Feature flags on first render with no flicker |
/capture |
Event Capture | Capture custom events from client components |
Feature Flags
Create these flags in your Insights project to see the demos in action:
example-flag-- Used by the Client Hooks and SSR Bootstrap demos. Can be boolean or multivariate.