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

@rhinon/botsdk-beta

v0.0.8

Published

A lightweight, framework-agnostic JavaScript SDK for integrating Rhinon chatbot into your web applications. Built with TypeScript and React, this SDK provides seamless chatbot integration across various platforms and frameworks.

Readme

@rhinon/botsdk

A lightweight, framework-agnostic JavaScript SDK for integrating Rhinon chatbot into your web applications. Built with TypeScript and React, this SDK provides seamless chatbot integration across various platforms and frameworks.

Features

  • 🚀 Easy Integration - Quick setup with just a few lines of code
  • ⚛️ Framework Support - Works with React, Next.js, Angular, Vue, and vanilla JavaScript
  • 🎨 Customizable - Configure appearance and behavior to match your brand
  • 📱 Responsive - Mobile-friendly design that works on all devices
  • 🔒 Secure - Built with security best practices
  • 🌐 SSR Compatible - Full support for server-side rendering frameworks
  • 💡 TypeScript - Full TypeScript support with type definitions
  • Lightweight - Minimal bundle size for optimal performance

Installation

Install the package using your preferred package manager:

# using npm
npm install @rhinon/botsdk

# using yarn
yarn add @rhinon/botsdk

# using pnpm
pnpm add @rhinon/botsdk

Quick Start

Basic Usage (Vanilla JavaScript)

import Rhinontech from '@rhinon/botsdk';

// Initialize when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
  Rhinontech({
    app_id: 'YOUR_APP_ID',
    chatbot_config: {
      isBgFade: true
    }
  });
});

Framework Integration

React

import { useEffect } from 'react';
import Rhinontech from '@rhinon/botsdk';

export default function Chatbot() {
  useEffect(() => {
    Rhinontech({
      app_id: 'YOUR_APP_ID',
      chatbot_config: {
        isBgFade: true
      }
    });
  }, []);

  return null;
}

Next.js

For Next.js applications, you need to handle SSR properly:

Step 1: Create a client component wrapper

// components/Chatbot/ChatbotWrapper.tsx
'use client';

import dynamic from 'next/dynamic';

const Chatbot = dynamic(() => import('./Chatbot'), {
  ssr: false,
});

export default function ChatbotWrapper() {
  return <Chatbot />;
}

Step 2: Create the main Chatbot component

// components/Chatbot/Chatbot.tsx
import { useEffect } from 'react';
import Rhinontech from '@rhinon/botsdk';

export default function Chatbot() {
  useEffect(() => {
    Rhinontech({
      app_id: 'YOUR_APP_ID',
      chatbot_config: {
        isBgFade: true
      }
    });
  }, []);

  return null;
}

Step 3: Add to your layout

// app/layout.tsx
import ChatbotWrapper from '@/components/Chatbot/ChatbotWrapper';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        {children}
        <ChatbotWrapper />
      </body>
    </html>
  );
}

Angular

// app.component.ts
import { Component, AfterViewInit, PLATFORM_ID, Inject } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';

@Component({
  selector: 'app-root',
  standalone: true,
  template: '',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements AfterViewInit {
  constructor(@Inject(PLATFORM_ID) private platformId: object) {}

  ngAfterViewInit() {
    if (isPlatformBrowser(this.platformId)) {
      import('@rhinon/botsdk').then((RhinontechModule) => {
        const Rhinontech = RhinontechModule.default;
        Rhinontech({
          app_id: 'YOUR_APP_ID',
          chatbot_config: {
            isBgFade: true
          }
        });
      });
    }
  }
}

Vue.js

<template>
  <div id="app">
    <!-- Your app content -->
  </div>
</template>

<script>
import { onMounted } from 'vue';
import Rhinontech from '@rhinon/botsdk';

export default {
  name: 'App',
  setup() {
    onMounted(() => {
      Rhinontech({
        app_id: 'YOUR_APP_ID',
        chatbot_config: {
          isBgFade: true
        }
      });
    });
  }
}
</script>

Configuration Options

The SDK accepts the following configuration options:

interface RhinontechConfig {
  app_id: string;              // Required: Your unique chatbot app ID
  admin?: boolean;             // Optional: Enable admin mode
  container?: HTMLElement;     // Optional: Custom container element
  chatbot_config?: {
    isBgFade?: boolean;        // Optional: Enable background fade effect
    // Add more config options as needed
  };
}

Basic Configuration

Rhinontech({
  app_id: 'YOUR_APP_ID',
  chatbot_config: {
    isBgFade: true
  }
});

Advanced Configuration

Rhinontech({
  app_id: 'YOUR_APP_ID',
  admin: false,
  container: document.getElementById('custom-container'),
  chatbot_config: {
    isBgFade: true
  }
});

API Reference

Rhinontech(config: RhinontechConfig): ChatBotElement

Initializes and returns a chatbot instance.

Parameters:

  • config (RhinontechConfig): Configuration object for the chatbot

Returns:

  • ChatBotElement: The chatbot custom element instance

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Opera (latest)

TypeScript Support

This package includes TypeScript type definitions. No additional @types package is required.

import Rhinontech, { RhinontechConfig, ChatBotElement } from '@rhinon/botsdk';

const config: RhinontechConfig = {
  app_id: 'YOUR_APP_ID',
  chatbot_config: {
    isBgFade: true
  }
};

const chatbot: ChatBotElement = Rhinontech(config);

Troubleshooting

SSR/Next.js Issues

If you encounter HTMLElement is not defined or similar errors:

  1. Ensure you're using dynamic imports with ssr: false
  2. Wrap the initialization in useEffect or equivalent lifecycle method
  3. Use the 'use client' directive for Next.js App Router

Chatbot Not Appearing

  1. Verify your app_id is correct
  2. Check browser console for errors
  3. Ensure the SDK is initialized after DOM is loaded
  4. Check if there are any CSP (Content Security Policy) restrictions

Examples

Check out our examples repository for complete implementation examples in various frameworks.

Support

For issues, questions, or contributions:

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.


Made with ❤️ by Rhinon Tech