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

@helpin-ai/react

v0.0.36

Published

Helpin JavaScript SDK for React

Readme

@helpin-ai/react

Helpin for React. Analytics, user identification, pageview tracking, and chat widget control — all through a single hook.

Installation

npm install @helpin-ai/react @helpin-ai/sdk-js

Quick Start

Wrap your app with HelpinProvider to make the client available throughout the component tree:

import React from 'react';
import ReactDOM from 'react-dom/client';
import { createClient, HelpinProvider } from '@helpin-ai/react';

const helpinClient = createClient({
  widgetKey: 'your-widget-key',
  host: 'https://client.helpin.ai',
  autoBoot: false,
});

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <HelpinProvider client={helpinClient}>
      <App />
    </HelpinProvider>
  </React.StrictMode>,
);

The chat widget boots automatically in the browser when widgetKey and host are set. Pass autoBoot: false to keep it dormant until you call show(), open(), or openNewMessage() — useful for custom launchers.

useHelpin()

The hook provides analytics, user identification, and widget control from any component:

import { useEffect } from 'react';
import { useHelpin } from '@helpin-ai/react';

function App() {
  const { id, track, lead, trackPageView, set, open } = useHelpin();

  useEffect(() => {
    void id({
      id: 'user_123',
      email: '[email protected]',
      name: 'Jane Doe',
    });
    trackPageView();
    set({ workspace: 'marketing-site' });
  }, [id, set, trackPageView]);

  return (
    <>
      <button onClick={() => track('cta_clicked', { cta: 'pricing' })}>
        Open Pricing
      </button>
      <button onClick={open}>Chat with us</button>
    </>
  );
}

Available methods

Analytics

| Method | Signature | Description | | --- | --- | --- | | trackPageView | () => void | Send a pageview event | | id | (userData, doNotSendEvent?) => Promise<void> | Identify the current user | | track | (eventName, payload?) => void | Track a custom event | | lead | (payload, directSend?) => void | Track a lead event | | rawTrack | (payload) => void | Send a raw event payload | | set | (properties, opts?) => void | Set global or event-scoped properties | | unset | (propertyName, opts?) => void | Remove a property added with set(...) |

Widget

| Method | Signature | Description | | --- | --- | --- | | show | () => void | Make the widget visible without opening chat | | hide | () => void | Hide the widget entirely | | open | () => void | Open the chat panel | | close | () => void | Close the chat panel while keeping the launcher visible | | toggle | () => void | Toggle the widget open or closed | | openMessages | () => void | Open the messages view | | openNewMessage | (content?) => void | Start a new conversation | | shutdown | () => void | End the session and unmount the widget |

For the complete client API (boot, group, reset, setUserId, getConfig, getLogger), use the object returned by createClient(...) directly.

usePageView()

Tracks route changes automatically by observing pushState, replaceState, and popstate. Optionally run setup logic or attach extra data before each pageview fires:

import { usePageView } from '@helpin-ai/react';

function AppShell() {
  usePageView({
    before: (helpin) => {
      void helpin.id({ id: 'user_123', email: '[email protected]' });
    },
    payload: {
      app_section: 'dashboard',
    },
  });

  return <AppRoutes />;
}

| Option | Type | Description | | --- | --- | --- | | before | (helpin) => void | Runs before each pageview event | | typeName | string | Custom event name (default: pageview) | | payload | EventPayload | Extra fields merged into the payload |

HelpinProvider

<HelpinProvider client={helpinClient}>
  <App />
</HelpinProvider>

| Prop | Type | Description | | --- | --- | --- | | client | HelpinClient \| null | The client returned by createClient(...) |

Exports

| Export | Description | | --- | --- | | createClient | Client factory | | HelpinProvider | React context provider | | HelpinContext | Raw React context (for advanced use) | | useHelpin | Analytics and widget hook | | usePageView | Automatic pageview tracking hook |

Development

pnpm --filter @helpin-ai/react build
pnpm --filter @helpin-ai/react test