1.4.1 • Published 4 months ago
bytedesk-web v1.4.1
bytedesk-web
Online customer service SDK, supporting multiple frameworks:
Installation Steps
Install Dependencies
npm install bytedesk-web
# 或
yarn add bytedesk-web
导入组件
import { BytedeskReact } from 'bytedesk-web/react';
import type { BytedeskConfig } from 'bytedesk-web/react';
配置参数
const config: BytedeskConfig = {
placement: 'bottom-right',
marginBottom: 20,
marginSide: 20,
bubbleConfig: {
show: true,
icon: '👋',
title: 'Need help?',
subtitle: 'Click to chat'
},
buttonConfig: {
show: true,
width: 60,
height: 60,
// icon: '👋',
// text: '需要帮助吗?',
},
chatConfig: {
org: 'df_org_uid', // 替换为您的组织ID
t: "2",
sid: 'df_rt_uid' // 替换为您的SID
}
};
使用组件
const App = () => {
const handleInit = () => {
console.log('BytedeskReact initialized');
};
return (
<div>
<BytedeskReact {...config} onInit={handleInit} />
<button onClick={() => (window as any).bytedesk?.showChat()}>
打开聊天
</button>
</div>
);
};
可用方法
# 显示/隐藏按钮
(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();
运行示例
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
开源Demo + SDK
Project | Description | Forks | Stars |
---|---|---|---|
iOS | iOS | ||
Android | Android | ||
Flutter | Flutter | ||
UniApp | Uniapp | ||
Web | Vue/React/Angular/Next.js/JQuery/... | ||
Wordpress | Wordpress | ||
Woocommerce | woocommerce | ||
Magento | Magento | ||
Prestashop | Prestashop | ||
Shopify | Shopify | ||
Opencart | Opencart | ||
Laravel | Laravel | ||
Django | Django |
1.4.1
4 months ago
1.3.9
4 months ago
1.3.8
4 months ago
1.3.7
5 months ago
1.2.8
6 months ago
1.3.6
5 months ago
1.2.7
6 months ago
1.3.5
5 months ago
1.2.6
6 months ago
1.3.4
5 months ago
1.2.5
6 months ago
1.2.4
6 months ago
1.3.2
6 months ago
1.2.3
6 months ago
1.3.1
6 months ago
1.2.2
6 months ago
1.2.1
6 months ago
1.2.9
6 months ago
1.1.9
6 months ago
1.1.8
6 months ago
1.1.7
6 months ago
1.1.6
6 months ago
1.1.5
6 months ago
1.1.4
6 months ago
1.1.3
6 months ago
1.1.11
6 months ago
1.1.10
6 months ago
1.1.1
6 months ago
1.0.19
6 months ago
1.0.2
6 months ago
1.1.0
6 months ago
1.0.18
6 months ago
1.0.17
6 months ago
1.0.16
6 months ago
1.0.9
6 months ago
1.0.7
6 months ago
1.0.5
6 months ago
1.0.4
6 months ago
1.1.2
6 months ago
1.0.3
6 months ago
1.0.11
6 months ago
1.0.10
6 months ago
1.0.15
6 months ago
1.0.14
6 months ago
1.0.24
6 months ago
1.0.13
6 months ago
1.0.12
6 months ago
1.0.1
6 months ago
1.0.0
6 months ago