Skip to content

inspectlet/inspectletjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inspectlet JavaScript SDKs

@inspectlet/browser @inspectlet/react license

Official Inspectlet packages for modern JavaScript apps — session recording, heatmaps, form analytics, and AI session insights in a few lines of code.

A modern alternative to LogRocket, FullStory, and Hotjar — with Inspectlet's deep form analytics, AI session insights, and a free tier that's free forever.

Package Description
@inspectlet/browser Typed wrapper around the Inspectlet tracker. Works in any browser app.
@inspectlet/react React provider, hooks, and automatic pageview tracking for Next.js / React Router.

Quickstart (React / Next.js)

npm install @inspectlet/browser @inspectlet/react
import { InspectletProvider } from '@inspectlet/react';

export default function App({ children }) {
  return (
    <InspectletProvider config={{ wid: 'YOUR_WID' }}>
      {children}
    </InspectletProvider>
  );
}

For automatic SPA pageview tracking, also import the adapter for your router:

import { useNextPageviews } from '@inspectlet/react/next';        // Next.js App Router
import { useReactRouterPageviews } from '@inspectlet/react/router'; // React Router v6+

Quickstart (vanilla JS / TS)

npm install @inspectlet/browser
import { init, inspectlet } from '@inspectlet/browser';

init({ wid: 'YOUR_WID' });

inspectlet.identify('user_123');
inspectlet.tagSession({ plan: 'pro' });

Why these packages?

  • No tracker bundling. The tracker JS still loads from cdn.inspectlet.com, so bug fixes and new features reach your users immediately — you don't need to redeploy your app to get tracker improvements.
  • TypeScript-first. Every command is typed.
  • SSR-safe. All methods are silent no-ops on the server. Works in Next.js, Remix, Nuxt, Astro, etc.
  • Tiny. ~1.5 KB gzipped, zero dependencies, tree-shakeable.

Repo layout

This is an npm workspaces monorepo.

packages/browser    # @inspectlet/browser
packages/react      # @inspectlet/react
examples/nextjs     # Next.js 14 App Router demo
examples/vite-react # Vite + React Router demo

Development

npm install
npm run build
npm test

License

MIT — see LICENSE.


Made by Inspectlet — session recording, heatmaps, form analytics, and AI session insights for product and growth teams.

Install free · Docs · Pricing · Compare to LogRocket · Compare to FullStory · Compare to Hotjar