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

chatbot-interface-ifi

v1.4.0

Published

A chatbot interface React component built to be integrated into NexLAB

Readme

Chatbot Interface IFI

Description: A chatbot interface React component built to be integrated into NexLAB

Version: 1.3.0

Installing:

npm install chatbot-interface-ifi

Basic Usage

import React, { useState, useRef } from 'react';
import { ChatbotInterface } from 'chatbot-interface-ifi';

const App = () => {
  const [conversationId, setConversationId] = useState(null);
  const chatbotRef = useRef(null);

  // Called when a new conversation starts - provides the Conversation ID
  const handleConversationStart = (newConversationId) => {
    console.log("Conversation started with ID:", newConversationId);
    setConversationId(newConversationId);
  };

  // Externally trigger endConversation on the chatbot
  const handleEndConversation = () => {
    if (chatbotRef.current) {
      chatbotRef.current.endConversation();
    }
  };

  return (
    <div>
      <ChatbotInterface
        ref={chatbotRef}
        chatbotId="your-chatbot-id-here"
        onConversationStart={handleConversationStart}
        enableGuidedQuestions={true}
      />
      <p>Current Conversation ID: {conversationId || "No conversation started yet."}</p>
      <button onClick={handleEndConversation}>End Conversation</button>
    </div>
  );
};

export default App;

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | chatbotId | string | required | The unique ID of the chatbot from the dashboard | | onConversationStart | function | undefined | Callback function that receives the conversation ID when a new conversation starts | | enableGuidedQuestions | boolean | false | Enable AI-suggested follow-up questions after each response | | customToggleButton | ReactNode | null | Custom React element to use as the chat toggle button |


Custom Toggle Button

You can customize the chat toggle button by passing your own React element via the customToggleButton prop:

import React from 'react';
import { ChatbotInterface } from 'chatbot-interface-ifi';

const App = () => {
  // Custom button with gradient and hover effects
  const customButton = (
    <div style={{
      width: 64,
      height: 64,
      borderRadius: '50%',
      background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'center',
      boxShadow: '0 6px 20px rgba(102, 126, 234, 0.5)',
      transition: 'transform 0.2s ease',
    }}>
      <span style={{ fontSize: 28, color: 'white' }}>💬</span>
    </div>
  );

  return (
    <ChatbotInterface
      chatbotId="your-chatbot-id-here"
      customToggleButton={customButton}
    />
  );
};

export default App;

Using an Image as Toggle Button

const customButton = (
  <img
    src="/your-custom-icon.png"
    alt="Chat"
    style={{
      width: 60,
      height: 60,
      borderRadius: '50%',
      boxShadow: '0 4px 12px rgba(0,0,0,0.3)',
    }}
  />
);

<ChatbotInterface
  chatbotId="your-chatbot-id-here"
  customToggleButton={customButton}
/>

Features

  • Guided Questions: AI-suggested follow-up questions (toggle on/off)
  • Summary: View a summary of the conversation
  • New Chat: Clear conversation and start fresh
  • Fullscreen Mode: Expand the chat to a larger modal view
  • Custom Toggle Button: Design your own chat open button
  • Responsive Design: Works on mobile, tablet, and desktop

Script Tag Embed (No React Required)

For static sites without React, you can embed the chatbot with a simple script tag:

<!DOCTYPE html>
<html>
  <head>
    <title>My Website</title>
    <meta charset="UTF-8" />
  </head>
  <body>
    <h1>Welcome to my website</h1>

    <script
      src="https://chatbot-embedding-ifi.onrender.com/chatbot-embed.js"
      data-chatbot-id="your-chatbot-id-here"
    ></script>
  </body>
</html>

Important: Make sure to include <meta charset="UTF-8" /> in the head tag.

Optional data-* Attributes

  • data-mode="chat|teach|dual": Defaults to dual
  • data-enable-guided-questions="true|false": Chat mode only, defaults to true
  • data-container-id="your-container-id": Mounts into an existing element instead of appending a new one to body
  • data-initial-session-id="teach_xxx": Teach mode restore target
  • data-session-ids="teach_a,teach_b": Teach mode session picker list
  • data-show-restart-button="true|false": Teach mode header control, defaults to true

Teach Mode Example

<div id="pat-teach-root"></div>
<script
  src="https://chatbot-embedding-ifi.onrender.com/chatbot-embed.js"
  data-mode="teach"
  data-chatbot-id="your-teach-chatbot-id"
  data-container-id="pat-teach-root"
  data-session-ids="teach_123,teach_456"
  data-initial-session-id="teach_123"
></script>

Dual Mode Example (Toggle Chat <-> Learn)

<script
  src="https://chatbot-embedding-ifi.onrender.com/chatbot-embed.js"
  data-mode="dual"
  data-chatbot-id="your-chatbot-id"
></script>

Build and Deploy Script Artifact

npm run build:embed

This outputs dist-embed/chatbot-embed.js. Deploy that file to your static host (Render static site, CDN, S3, etc.), then use its public URL in the src attribute.


Links

  • Chatbot Dashboard: https://chatbot-dashboard-ifi.onrender.com
  • NPM Package: https://www.npmjs.com/package/chatbot-interface-ifi

License

MIT