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 🙏

© 2025 – Pkg Stats / Ryan Hefner

teko-chatbot-ui

v0.0.23

Published

A React component library that provides a floating chatbot widget with customizable themes, real-time messaging, and easy integration.

Readme

Teko Chatbot UI

A React component library that provides a floating chatbot widget with customizable themes, real-time messaging, and easy integration.

Features

  • 🚀 SSR Safe: Fully compatible with Next.js and other SSR frameworks
  • 🌍 Internationalization: Built-in i18n support
  • 🎨 Customizable: Theme and styling customization
  • 💬 Real-time Messaging: WebSocket support for live chat
  • 📱 Responsive: Works on desktop and mobile devices
  • 🔒 Error Handling: Built-in error boundaries and fallbacks

SSR Safety

This library is designed to be completely safe for Server-Side Rendering (SSR) environments like Next.js. The following safety measures are implemented:

✅ SSR Safety Features

  1. Window Check: All browser-specific APIs are wrapped with typeof window !== 'undefined' checks
  2. localStorage Safety: Safe access to localStorage with try-catch blocks
  3. DOM Manipulation: All DOM operations are guarded against SSR execution
  4. Event Listeners: Document event listeners are only added after client-side mounting
  5. API Calls: Network requests are prevented during SSR
  6. UUID Generation: Safe UUID generation that doesn't break SSR
  7. Placeholder Rendering: During SSR, only a minimal placeholder is rendered

🔧 How It Works

// The component automatically detects SSR and renders safely
import FloatingChatbot from 'teko-chatbot-ui';

// During SSR: Renders only the floating button placeholder
// During Client: Renders full interactive component
<FloatingChatbot
  terminalId='your-terminal-id'
  // ... other props
/>;

Installation

npm install teko-chatbot-ui
# or
yarn add teko-chatbot-ui

Usage

Basic Usage

import FloatingChatbot from 'teko-chatbot-ui';

function App() {
  return (
    <FloatingChatbot
      terminalId='your-terminal-id'
      aiAgentCode='SGC'
      env='DEV'
      getAccessToken={() => 'your-access-token'}
      getUserId={() => 'user-id'}
    />
  );
}

Next.js Integration

The library works seamlessly with Next.js without any additional configuration:

// pages/index.tsx or app/page.tsx
import FloatingChatbot from 'teko-chatbot-ui';

export default function HomePage() {
  return (
    <div>
      <h1>Welcome to our site</h1>
      <FloatingChatbot
        terminalId='your-terminal-id'
        aiAgentCode='SGC'
        env='PROD'
        getAccessToken={() => localStorage.getItem('token') || ''}
        getUserId={() => localStorage.getItem('userId') || ''}
      />
    </div>
  );
}

Props

| Prop | Type | Required | Default | Description | | ---------------- | ------------------------- | -------- | ---------------------- | ---------------------------- | | terminalId | string | ✅ | - | Terminal identifier | | aiAgentCode | string | ❌ | 'SGC' | AI agent code | | env | 'DEV' | 'STAG' | 'PROD' | ❌ | 'DEV' | Environment | | getAccessToken | () => string | ✅ | - | Function to get access token | | getUserId | () => string | ❌ | - | Function to get user ID | | position | 'fixed' | 'absolute' | ❌ | 'fixed' | Position of the chatbot | | theme | 'light' | 'dark' | ❌ | 'light' | Theme | | title | string | ❌ | 'Chat Support' | Chat title | | placeholder | string | ❌ | 'Type your message...' | Input placeholder | | lng | string | ❌ | 'en' | Language code | | onError | (error: Error) => void | ❌ | - | Error handler | | errorFallback | React.ReactNode | ❌ | - | Error fallback component |

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

License

ISC