# bytedesk-web
**Repository Path**: natural-meow/bytedesk-web
## Basic Information
- **Project Name**: bytedesk-web
- **Description**: h5 + pc web客服
- **Primary Language**: JavaScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://www.bytedesk.com/
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 14
- **Created**: 2025-02-07
- **Last Updated**: 2025-02-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# bytedesk-web
Online customer service SDK, supporting multiple frameworks:
- [React Guide](examples/react-demo/readme.md)
- [Next.js Guide](examples/nextjs-demo/readme.md)
- [Vue Guide](examples/vue-demo/readme.md)
- [Svelte Guide](examples/svelte-demo/readme.md)
- [Angular Guide](examples/angular-demo/readme.md)
- [JavaScript Guide](examples/javascript-demo/readme.md)


[English Document](readme.md)
## Installation Steps
### Install Dependencies
```bash
npm install bytedesk-web
# 或
yarn add bytedesk-web
```
### 导入组件
```bash
import { BytedeskReact } from 'bytedesk-web/react';
import type { BytedeskConfig } from 'bytedesk-web/react';
```
### 配置参数
```bash
const config: BytedeskConfig = {
placement: 'bottom-right',
marginBottom: 20,
marginSide: 20,
bubbleConfig: {
show: true,
icon: '👋',
title: 'Need help?',
subtitle: 'Click to chat'
},
chatConfig: {
org: 'df_org_uid', // 替换为您的组织ID
t: "2",
sid: 'df_rt_uid' // 替换为您的SID
}
};
```
### 使用组件
```bash
const App = () => {
const handleInit = () => {
console.log('BytedeskReact initialized');
};
return (
);
};
```
### 可用方法
```bash
# 显示/隐藏按钮
(window as any).bytedesk?.showButton();
(window as any).bytedesk?.hideButton();
# 显示/隐藏气泡消息
(window as any).bytedesk?.showBubble();
(window as any).bytedesk?.hideBubble();
# 显示/隐藏聊天窗口
(window as any).bytedesk?.showChat();
(window as any).bytedesk?.hideChat();
# 显示/隐藏邀请对话框
(window as any).bytedesk?.showInviteDialog();
(window as any).bytedesk?.hideInviteDialog();
```
## 运行示例
```bash
yarn install
yarn demo:react # Run React demo
yarn demo:vue # Run Vue demo
yarn demo:svelte # Run Svelte demo
yarn demo:vanilla # Run Vanilla JS demo
yarn demo:angular # Run Angular demo
yarn demo:nextjs # Run Next.js demo
# JavaScript demo requires build first
yarn build
yarn demo:javascript
```
## Chat SDK
| Project | Description | Forks | Stars |
|-------------|-----------------------|----------------|-------------------|
| [iOS-swift](https://github.com/bytedesk/bytedesk-swift) | iOS swift |  |  |
| [Android](https://github.com/bytedesk/bytedesk-android) | Android |  |  |
| [Flutter](https://github.com/bytedesk/bytedesk-flutter) | Flutter | |  |
| [UniApp](https://github.com/bytedesk/bytedesk-uniapp) | Uniapp |  |  |
| [Web](https://github.com/bytedesk/bytedesk-web) | Web |  |  |
| [Wordpress](https://github.com/bytedesk/bytedesk-wordpress) | Wordpress |  |  |
| [Woocommerce](https://github.com/bytedesk/bytedesk-woocommerce) | woocommerce |  |  |
| [Magento](https://github.com/bytedesk/bytedesk-magento) | Magento |  |  |
| [Prestashop](https://github.com/bytedesk/bytedesk-prestashop) | Prestashop |  |  |
| [Shopify](https://github.com/bytedesk/bytedesk-shopify) | Shopify |  |  |
| [Opencart](https://github.com/bytedesk/bytedesk-opencart) | Opencart |  |  |
| [Laravel](https://github.com/bytedesk/bytedesk-laravel) | Laravel |  |  |
| [Django](https://github.com/bytedesk/bytedesk-django) | Django |  |  |