npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@inspectlet/react

v1.0.1

Published

Official Inspectlet React SDK — provider, hooks, and automatic pageview tracking for Next.js and React Router. Session recording, heatmaps, and form analytics.

Readme

@inspectlet/react

npm types license

Official Inspectlet React SDK — session recording, heatmaps, form analytics, and AI session insights for React, Next.js, and Vite apps. Ergonomic provider, hooks, and automatic pageview tracking for Next.js App Router and React Router.

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

  • Drop-in for any React app. Just wrap your tree with <InspectletProvider>.
  • Auto pageview tracking for Next.js App Router and React Router v6+.
  • TypeScript-first. Hooks return a fully typed Inspectlet API.
  • SSR-safe. init() runs in useEffect, so Inspectlet only loads in the browser.
  • Tree-shakeable. Framework adapters live behind subpath imports — pay for what you use.

Install

npm install @inspectlet/browser @inspectlet/react

Quickstart

Next.js (App Router)

// app/providers.tsx
'use client';

import { InspectletProvider } from '@inspectlet/react';
import { useNextPageviews } from '@inspectlet/react/next';

function NextPageviewTracker() {
  useNextPageviews();
  return null;
}

export function Providers({ children }: { children: React.ReactNode }) {
  return (
    <InspectletProvider config={{ wid: 'YOUR_WID', disableVirtualPage: true }}>
      <NextPageviewTracker />
      {children}
    </InspectletProvider>
  );
}
// app/layout.tsx
import { Providers } from './providers';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body><Providers>{children}</Providers></body>
    </html>
  );
}

Vite + React Router

import { BrowserRouter } from 'react-router-dom';
import { InspectletProvider } from '@inspectlet/react';
import { useReactRouterPageviews } from '@inspectlet/react/router';

function PageviewTracker() {
  useReactRouterPageviews();
  return null;
}

function App() {
  return (
    <BrowserRouter>
      <InspectletProvider config={{ wid: 'YOUR_WID', disableVirtualPage: true }}>
        <PageviewTracker />
        <Routes>{/* ... */}</Routes>
      </InspectletProvider>
    </BrowserRouter>
  );
}

Plain React (no router)

import { InspectletProvider } from '@inspectlet/react';

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

Hooks

useInspectlet()

Returns the typed Inspectlet API. Works inside or outside <InspectletProvider> (falls back to the singleton).

import { useInspectlet } from '@inspectlet/react';

function CheckoutButton() {
  const insp = useInspectlet();
  return (
    <button onClick={() => insp.tagSession({ event: 'checkout-clicked' })}>
      Buy
    </button>
  );
}

useInspectletIdentify(userId, tags?)

Identifies the user and optionally tags the session. Pass null/undefined to skip while auth is still resolving.

import { useInspectletIdentify } from '@inspectlet/react';

function App() {
  const { user } = useAuth();
  useInspectletIdentify(user?.email, { plan: user?.plan });
  return <Routes />;
}

useNextPageviews()@inspectlet/react/next

Reports a virtual pageview on every Next.js App Router navigation. Requires next >= 13.

useReactRouterPageviews()@inspectlet/react/router

Reports a virtual pageview on every React Router v6+ location change.

Tip: When using either pageview hook, set disableVirtualPage: true on the provider config so Inspectlet's built-in history.pushState listener doesn't fire alongside the hook (which would double-count pageviews).

Configuration

<InspectletProvider config={...}> accepts the same config as init() from @inspectlet/browser. Common options:

<InspectletProvider config={{
  wid: 'YOUR_WID',                  // required
  enabled: process.env.NODE_ENV === 'production',
  disableVirtualPage: true,         // when using pageview hooks
  cookieLocation: '.example.com',
  crossDomain: ['app.com', 'docs.com'],
}} />

The config is captured on mount — changing it later won't re-init Inspectlet. If you need different settings for different environments, branch on the config you pass:

const config = isProd ? prodConfig : devConfig;
<InspectletProvider config={config}>{children}</InspectletProvider>

License

MIT


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

Install free · Docs · Pricing · Compare