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

aio-chat-wc

v1.0.2

Published

All in one chat web component includes a web component and a backend service for real-time chat.

Readme

AIOChatWC

AIOChatWC or in other words All in one chat web component is a highly configurable chat solution that includes a web component for embedding chat functionality into your frontend and a backend service for managing chat logic, authentication, and database interactions.

Features

  • Web Component: Easily embed a chat widget into your application.
  • Backend Service: Manage chat logic, authentication, and database interactions.
  • Authentication: Supports multiple authentication methods, including JWT, Proxy, and Custom.
  • Database Support: Works with SQLite, MySQL, and PostgreSQL.
  • Customizability: Override default behavior for both the web component and backend service.

Documentation

The documentation is divided into two main sections:

  1. Web Component: Learn how to set up and configure the AIOChatWC web component.
  2. Service: Understand the backend service, its configuration, and customization options.

Quick Start

Installation

Install the package:

npm install aio-chat-wc

Also, ensure Vue.js is installed in your project:

npm install vue

Web Component

The AIOChatWC web component allows you to embed a chat widget into your application. It supports two ways to initialize:

  1. Using the <chat-widget> HTML Element:

    <chat-widget user_id="123" service_url="https://your-backend.com"></chat-widget>
  2. Using the initChatWidget Function:

    import { initChatWidget } from 'aio-chat-wc';
    
    initChatWidget({
      user_id: 123,
      service_url: 'https://your-backend.com',
      container: document.querySelector('#chat-container')
    });

For more details, refer to the Web Component Documentation.


Service

The AIOChatWC service provides the backend functionality required for chat, including database management, authentication, and chat logic.

Key Features

  • Authentication: Supports Direct, Auth Endpoint, JWT, Proxy, and Custom authentication methods.
  • Database: Works with SQLite, MySQL, and PostgreSQL. Includes migration utilities.
  • Customizability: Override default chat logic and user filtering.

Setup

  1. Create a file to start the service (e.g., chat_service.js).

  2. Import and start the service:

    import { startService } from 'aio-chat-wc/service';
    
    startService(config)
      .then(() => console.log("Chat service started successfully."))
      .catch((err) => console.error("Failed to start chat service:", err));
  3. Add a start command to your package.json:

    "scripts": {
      "start:service": "node path/to/chat_service.js"
    }

For more details, refer to the Service Documentation.


Configuration

Both the web component and service are highly configurable. Key configuration options include:

  • Web Component:

    • service_url: The base URL of the chat service.
    • user_id: The ID of the authenticated user.
    • token: The JWT token used for authentication.
  • Service:

    • DB_TYPE: Type of database (sqlite, mysql, or postgres).
    • AUTH_MODE: Authentication mode (direct, auth-endpoint, jwt, proxy, or custom).
    • user_mapping: Map user fields to your database schema.

For a full list of configuration options, refer to the Configuration Documentation.


Authentication

AIOChatWC supports multiple authentication methods:

  1. Direct: Quick prototyping with minimal setup.
  2. Auth Endpoint: Verifies users through a backend endpoint.
  3. JWT: Uses existing JWT authentication systems.
  4. Proxy: Routes all chat requests through an authenticated backend.
  5. Custom: Implements custom authentication logic.

For detailed instructions, refer to the Authentication Documentation.


Database

AIOChatWC supports SQLite, MySQL, and PostgreSQL. It includes migration utilities to set up and manage the database schema.

  • SQLite: Ideal for quick setups or local development.
  • MySQL/PostgreSQL: Recommended for production environments.

For more details, refer to the Database Documentation.


Customization

AIOChatWC is designed to be highly customizable:

  • Web Component: Customize the widget's behavior. In the future change modes and appearance.
  • Service: Override default chat logic, user filtering, authentication and connect it to your existing database.

For advanced use cases, refer to the Chat Service Documentation.


Best Practices

  1. Change Default Authentication Method: Avoid using the default authentication method (direct) in production. Choose an authentication method that best fits your application's needs, such as jwt, proxy, or custom.
  2. Update Authentication Defaults: Replace default authentication values like TOKEN_SECRET and PROXY_SECRET with secure, unique values to enhance security.
  3. Migrations: Before running migrations on existing database make sure to check documentation on User Entity customization

Troubleshooting

Common Issues

  • Authentication Errors: Ensure secrets and token names match between your app and the chat service.
  • CORS Issues: Configure CORS on both your proxy endpoint and the chat service.
  • Database Errors: Verify your database configuration and run migrations.

For more help, check the GitHub repository or create a new issue.


License

This project is licensed under the MIT License.