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-web-sdk

v0.1.5

Published

Web SDK for Avya chatbot widget (React, Next.js, Nuxt, and plain JS).

Downloads

696

Readme

chatbot-web-sdk

Lightweight web SDK to load the Avya chatbot widget in React, Next.js, Nuxt, and plain JavaScript applications.

Features

  • Single config object setup
  • Supports React, Next.js, Nuxt, and plain JS
  • Automatically injects the widget script only once
  • Runtime config updates with updateChatWidgetConfig
  • Optional widget cleanup with destroyChatWidget
  • Works with both JavaScript and TypeScript projects

Install

npm install chatbot-web-sdk

API Key Configuration

This package requires a valid API key to enable AI-powered chatbot functionality.

To obtain the customized API key, please visit https://chat.avya.lk/ and register there. For further information, please contact through https://avya.lk/contact-us/.

Configuration Options

You can also select and manage these configurations from the Playground section in https://chat.avya.lk/.

| Property | Type | Default | Description | | --- | --- | --- | --- | | title | string | required | Title displayed in the chat header | | themeColor | string | #007BFF | Primary color for the chat widget | | initialMessage | string | Hi! How can I help you today? | Bot's greeting message | | apiKey | string | "" | API key for backend authentication | | profilePicUrl | string | null | URL for bot profile image |

Nuxt (TypeScript Plugin)

Create plugins/chat-widget.client.ts:

import { createNuxtChatWidgetPlugin } from "chatbot-web-sdk/nuxt";

export default defineNuxtPlugin(
  createNuxtChatWidgetPlugin({
    title: "My ChatBot test",
    themeColor: "#D91D1D",
    initialMessage: "Hi! How can I help you today?",
    profilePicUrl: "https://chat.avya.lk/images/logo.webp",
    apiKey: "<YOUR_API_KEY>",
  })
);

Nuxt (JavaScript Plugin)

Create plugins/chat-widget.client.js:

import { createNuxtChatWidgetPlugin } from "chatbot-web-sdk/nuxt";

export default defineNuxtPlugin(
  createNuxtChatWidgetPlugin({
    title: "My ChatBot test",
    themeColor: "#D91D1D",
    initialMessage: "Hi! How can I help you today?",
    profilePicUrl: "https://chat.avya.lk/images/logo.webp",
    apiKey: "<YOUR_API_KEY>",
  })
);

Nuxt (Vue app.vue)

<script setup>
import { onMounted } from "vue";
import { initChatWidget } from "chatbot-web-sdk";

const config = {
  title: "My ChatBot test",
  themeColor: "#D91D1D",
  initialMessage: "Hi! How can I help you today?",
  profilePicUrl: "https://chat.avya.lk/images/logo.webp",
  apiKey: "<YOUR_API_KEY>",
};

onMounted(() => {
  initChatWidget(config);
});
</script>

<template>
  <div>Nuxt App</div>
</template>

React (TSX)

import { useChatWidget } from "chatbot-web-sdk/react";
import type { ChatConfig } from "chatbot-web-sdk";

const config: ChatConfig = {
  title: "My ChatBot test",
  themeColor: "#D91D1D",
  initialMessage: "Hi! How can I help you today?",
  profilePicUrl: "https://chat.avya.lk/images/logo.webp",
  apiKey: "<YOUR_API_KEY>",
};

export default function App() {
  useChatWidget(config);
  return <div>React App</div>;
}

React (JSX)

import { useChatWidget } from "chatbot-web-sdk/react";

const config = {
  title: "My ChatBot test",
  themeColor: "#D91D1D",
  initialMessage: "Hi! How can I help you today?",
  profilePicUrl: "https://chat.avya.lk/images/logo.webp",
  apiKey: "<YOUR_API_KEY>",
};

export default function App() {
  useChatWidget(config);
  return <div>React App</div>;
}

React (Next.js App Router)

"use client";

import { useChatWidget } from "chatbot-web-sdk/react";

const config = {
  title: "My ChatBot test",
  themeColor: "#D91D1D",
  initialMessage: "Hi! How can I help you today?",
  profilePicUrl: "https://chat.avya.lk/images/logo.webp",
  apiKey: "<YOUR_API_KEY>",
};

export default function Page() {
  useChatWidget(config);
  return <div>Next App</div>;
}

For more references and code guidance for other languages, please visit https://chat.avya.lk/.