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

@helperai/react

v0.9.5

Published

React/Next.js integration for Helper chat widget

Readme

Helper React

npm version TypeScript License: MIT

A powerful React integration for the Helper chat widget, featuring first-class support for Next.js and modern React applications.

Features

  • 🚀 First-class Next.js App Router support
  • 💪 Full TypeScript support
  • 🔒 Secure authentication handling
  • 🎨 Customizable UI and theming
  • 🔌 Framework-agnostic core
  • �� Responsive design
  • 🔄 Comprehensive API hooks for direct integration

Installation

npm install @helperai/react
# or
yarn add @helperai/react
# or
pnpm add @helperai/react

Quick Start

Basic Setup

import { generateHelperAuth, HelperProvider } from "@helperai/react";

function App() {
  const authData = generateHelperAuth({
    email: "[email protected]",
    hmacSecret: process.env.HELPER_HMAC_SECRET!,
  });

  return (
    <HelperProvider host="https://helper.ai" {...authData}>
      <YourApp />
    </HelperProvider>
  );
}

API Reference

Core Provider

HelperProvider

Provides global state management for Helper functionality, supporting both widget and API-based integrations.

<HelperProvider
  host="https://helper.ai"
  email="[email protected]"
  emailHash="hmac-hash"
  timestamp={Date.now()}
  customerMetadata={{
    name: "John Doe",
    value: 1000,
    links: { Profile: "https://example.com/profile" },
  }}
  tools={{
    searchKnowledge: {
      description: "Search knowledge base",
      parameters: { query: { type: "string", description: "Search query" } },
      execute: async ({ query }) => ({ results: [] }),
    },
  }}
>
  {children}
</HelperProvider>

Hooks

useHelperContext()

Accesses the Helper context for advanced integration scenarios.

const {
  host, // string - The Helper host URL
  tools, // Record<string, HelperTool> - Available tools
  getToken, // () => Promise<string> - Get authentication token
} = useHelperContext();

useHelper()

Controls the Helper widget visibility and behavior.

const {
  show, // () => void
  hide, // () => void
  toggle, // () => void
  sendPrompt, // (prompt: string) => void
} = useHelper();

Authentication

generateHelperAuth()

Server-side helper for generating HMAC authentication data.

import { generateHelperAuth } from "@helperai/react";

const authData = generateHelperAuth({
  email: "[email protected]",
  hmacSecret: process.env.HELPER_HMAC_SECRET!, // Optional: can also use HELPER_HMAC_SECRET env var
});
// Returns: { email, timestamp, emailHash }

Next.js Integration

App Router

// app/layout.tsx
import { HelperWidgetScript } from "@helperai/react";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        <HelperWidgetScript host={process.env.NEXT_PUBLIC_NEXT_PUBLIC_DEV_HOST!} />
        {children}
      </body>
    </html>
  );
}

Server Components

// app/dashboard/page.tsx
import { generateHelperAuth } from "@helperai/react";

export default function DashboardPage() {
  const authData = generateHelperAuth({
    email: "[email protected]",
    hmacSecret: process.env.HELPER_HMAC_SECRET!,
  });

  return (
    <HelperProvider
      host="https://helper.ai"
      email={authData.email}
      emailHash={authData.emailHash}
      timestamp={authData.timestamp}
    >
      <ChatInterface />
    </HelperProvider>
  );
}

Best Practices

Security

  • Keep HELPER_HMAC_SECRET secure and never expose it client-side
  • Generate authentication tokens server-side using generateHelperAuth()
  • Validate user sessions before initializing Helper
  • Use environment variables for sensitive configuration

Performance

  • Initialize Helper only after user authentication
  • Implement proper cache invalidation strategies
  • Use framework-specific optimizations when available

Troubleshooting

Common Issues

Widget Not Loading

  • Verify environment variables are correctly set
  • Ensure HMAC generation is working using generateHelperAuth()
  • Check network requests for authentication errors

Authentication Failures

  • Confirm HMAC secret matches dashboard configuration
  • Verify timestamp is current (generated server-side)
  • Validate email format and consistency

API Calls Failing

  • Ensure authentication data is properly set in the provider
  • Check network connectivity and CORS settings
  • Verify API endpoint URLs are correct

Contributing

This package is part of the Helper project. Please refer to the main repository for contribution guidelines.

License

MIT License - see LICENSE file for details.