2.0.1 • Published 1 year ago

ermis-chat-widget v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Overview

Chatbot Demo

GitHub license npm version PRs Welcome

NPM Package Link: ermis-chat-widget

ermis-chat-widget is a library for creating React.js, built using TypeScript.

Features:

  • Implemented using React.js and TypeScript for robustness and type safety.
  • Provides a customizable user interface for integrating chatbot functionality into web applications.
  • Offers various configuration options to tailor the chatbot widget's appearance and behavior.

Usage

  1. Install the latest version:
npm install ermis-chat-widget@latest
yarn add ermis-chat-widget@latest
  1. Import the library:
import { ErmisChatWidget } from "ermis-chat-widget";
  1. Use the ErmisChatWidget component:
<ErmisChatWidget
  apiKey="YOUR_API_KEY"
  openWidget={openWidget}
  onToggleWidget={onToggleWidget}
  token="YOUR_TOKEN"
  senderId="YOUR_WALLET_ADDRESS"
  receiverId="RECEIVER_WALLET_ADDRESS" // optional
  primaryColor="#eb4034" // optional
  placement={{ top: "auto", left: "auto", right: "30px", bottom: "30px" }} // optional
/>

Usage Example

import React from "react";
import { ErmisChatWidget } from "ermis-chat-widget";

const App = () => {
  const [open, setOpen] = useState(false);

  const onToggleWidget = () => {
    setOpen(!open);
  };

  return (
    <div>
      <ErmisChatWidget
        apiKey="YOUR_API_KEY"
        openWidget={open}
        onToggleWidget={onToggleWidget}
        token="YOUR_TOKEN"
        senderId="YOUR_WALLET_ADDRESS"
        receiverId="RECEIVER_WALLET_ADDRESS" // optional
        primaryColor="#eb4034" // optional
        placement={{ top: "auto", left: "auto", right: "30px", bottom: "30px" }} // optional
      />
    </div>
  );
};

export default App;

Component Props

Prop NameTypeDefault ValueDescription
apiKeystringYour API key for authenticating the chat widget.
openWidgetbooleanfalseBoolean value to control whether the widget is open (true) or closed (false) on initial load.
onToggleWidgetfunction-Callback function that triggers when the widget is toggled. Receives a boolean argument indicating the widget's current state (true for open, false for closed).
tokenstring-Authentication token for the user, ensuring secure communication.
senderIdstring-Unique identifier for the message sender.
receiverIdstring- (optional)Unique identifier for the message receiver.
primaryColorstring"#eb4034" (optional)The primary color used for styling elements like headers, buttons, and backgrounds.
placementobject{ top: "auto", left: "auto", right: "30px", bottom: "30px" } (optional)Placement of popup widget
2.0.1

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

2.0.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago