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

smc-chat

v1.0.2

Published

SMC Chat Widget Core COmponent

Readme

Here is a detailed README.md file for your smc-chat npm package:


smc-chat

The smc-chat package provides a customizable chat widget designed for seamless integration into web applications. It supports features like personalized themes, configurable API endpoints, and dynamic session handling, making it ideal for building interactive chat assistants.

Installation

To install the package, use the following command:

npm install smc-chat

Importing the Package

To use the chat widget in your project, import it as follows:

import 'smc-chat';

Usage

Add the `` component to your HTML or JSX code to integrate the chat widget. Below is an example configuration:

Explanation of Attributes

  • user-name: Specifies the default name displayed for the user in the chat. Example: "You".
  • header-icon: URL for the icon displayed in the chat header. Leave empty for no icon.
  • header-text: Text displayed in the chat header. Example: "Stoxkart Assistant".
  • theme: Defines the theme of the chat widget. Options: "light" or "dark".
  • welcome-message: The initial message displayed when the chat starts. Example: "Welcome to Stoxkart! How can I help you today?".
  • start-chat-logo: URL for an image/logo shown at the start of the chat.
  • primary-color: Hex color code for the primary theme color of the widget. Example: "#0ca750".
  • secondary-color: Hex color code for secondary elements in the theme. Example: "gray".
  • position: Specifies where the widget appears on the screen. Options: "right" or "left".
  • api-url: The endpoint URL where chat messages are sent and received.
  • input-placeholder: Placeholder text for the input field. Example: "Type your Question here...".
  • session: A dynamic session object passed to manage user sessions.

API Keys and Headers

The following headers are required for API communication:

{
  "x-platform-agent": "web",
  "x-prompt-session-attribute": {
    "oauthToken": "token",
    "clientCode": "code"
  },
  "x-session-attribute": {
    "oauthToken": "token",
    "clientCode": "code"
  },
  "x-api-key": "access key"
}

Explanation of Keys:

  • x-platform-agent: Identifies the platform making requests (e.g., "web").
  • x-prompt-session-attribute.oauthToken: OAuth token used for authentication.
  • x-prompt-session-attribute.clientCode: Unique identifier for the client.
  • x-session-attribute.oauthToken: Another OAuth token for session-specific authentication.
  • x-session-attribute.clientCode: Session-specific client identifier.
  • x-api-key: API key required to authenticate requests.

Integration Steps

  1. Install and import smc-chat.
  2. Add `` to your application with appropriate attributes.
  3. Configure your API endpoint and headers as shown above.
  4. Pass a valid session object dynamically to maintain user sessions.

Example Integration

import React from 'react';
import 'smc-chat';

const App = () => {
  const session = {
    oauthToken: 'token',
    clientCode: 'code'
  };

  return (
  );
};

export default App;

License

This package is licensed under MIT License.


This README file provides a comprehensive guide to installing, configuring, and integrating the smc-chat package into a project.

Citations: [1] https://www.npmjs.com/package/@appnest/readme [2] https://www.npmjs.com/package/create-readme [3] https://www.npmjs.com/package/@ibbatta/readme-generator [4] https://docs.npmjs.com/about-package-readme-files/ [5] https://www.npmjs.com/package/file-structure [6] https://www.npmjs.com/package/readme-md [7] https://www.npmjs.com/package/package-json-to-readme [8] https://docs.npmjs.com/about-packages-and-modules/


Answer from Perplexity: pplx.ai/share