# web-chatbot-sdk **Repository Path**: benchu-project/web-chatbot-sdk ## Basic Information - **Project Name**: web-chatbot-sdk - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-10 - **Last Updated**: 2025-03-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Web Chatbot SDK A lightweight SDK for embedding a customizable chatbot into your web applications. ## Installation ```bash npm install web-chatbot-sdk ``` ## Quick Start Add the container div to your HTML: ```html
``` Import and initialize the SDK: ```javascript import { ChatbotSDK } from 'web-chatbot-sdk'; const chatbot = new ChatbotSDK({ containerId: 'chatbot-container', width: '350px', height: '600px', position: 'fixed', bottom: '20px', right: '20px', url: 'http://47.236.204.213:3002', }); chatbot.init(); ``` ## Configuration Options | Option | Type | Default | Description | | ----------- | ------ | -------- | -------------------------------------------------------- | | containerId | string | required | ID of the HTML element where the chatbot will be mounted | | width | string | '350px' | Width of the chatbot window | | height | string | '600px' | Height of the chatbot window | | position | string | 'fixed' | CSS position property | | bottom | string | '20px' | Bottom spacing | | right | string | '20px' | Right spacing | | url | string | required | Backend service URL | --- # Web 聊天机器人 SDK 一个轻量级的 SDK,用于在网页应用中嵌入可定制的聊天机器人。 ## 安装 ```bash npm install web-chatbot-sdk ``` ## 快速开始 在 HTML 中添加容器 div: ```html ``` 导入并初始化 SDK: ```javascript import { ChatbotSDK } from 'web-chatbot-sdk'; const chatbot = new ChatbotSDK({ containerId: 'chatbot-container', width: '350px', height: '600px', position: 'fixed', bottom: '20px', right: '20px', url: 'http://47.236.204.213:3002', }); chatbot.init(); ``` ## 配置选项 | 选项 | 类型 | 默认值 | 说明 | | ----------- | ------ | ------- | ----------------------------- | | containerId | string | 必填 | 聊天机器人挂载的 HTML 元素 ID | | width | string | '350px' | 聊天窗口宽度 | | height | string | '600px' | 聊天窗口高度 | | position | string | 'fixed' | CSS position 属性 | | bottom | string | '20px' | 底部间距 | | right | string | '20px' | 右侧间距 | | url | string | 必填 | 后端服务 URL |