1.0.2 • Published 5 months ago

dxchatbot-widget v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Dx Chatbot Widget

A lightweight, customizable chatbot widget that can be easily integrated into any website.

Features

  • 📱 Responsive design that works on both desktop and mobile devices
  • 🔒 Secure cross-origin communication
  • 🎨 Customizable positioning
  • 🚀 Easy to integrate
  • ⚡ Lightweight implementation

Installation

npm install dxchatbot-widget
# or
yarn add dxchatbot-widget

Usage

Import and initialize the chatbot widget in your application:

import { initChatbot } from "dxchatbot-widget";

initChatbot({
  domainId: "your-domain-id",
  domain: "https://your-chatbot-domain.com",
  position: {
    bottom: "50px", // Optional: defaults to '50px'
    right: "50px", // Optional: defaults to '50px'
  },
});

Configuration Options

ParameterTypeDescriptionDefault
domainIdstringYour unique domain identifierRequired
domainstringThe domain where your chatbot is hostedRequired
positionobjectPositioning configuration for the widget{ bottom: '50px', right: '50px' }
position.bottomstringDistance from bottom of the viewport'50px'
position.rightstringDistance from right of the viewport'50px'

Mobile Responsiveness

The widget automatically adjusts its layout for mobile devices (screens smaller than 768px):

  • Takes up most of the viewport width
  • Adjusts height to 90% of viewport height
  • Maintains proper spacing and usability on smaller screens

Security

The widget implements secure cross-origin communication and only processes messages from the specified domain.

Browser Support

This widget supports all modern browsers including:

  • Chrome
  • Firefox
  • Safari
  • Edge

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.