Skip to content

bytedesk customer service web chat widget, support vue/react/nextjs/angular/svelte/vanilla/javascript/typescrpt...

License

Notifications You must be signed in to change notification settings

Bytedesk/bytedesk-web

Repository files navigation

bytedesk-web

Online customer service SDK, supporting multiple frameworks:

admin chat

中文文档

Installation Steps

Install Dependencies

npm install bytedesk-web
# or
yarn add bytedesk-web

Import Component

import { BytedeskReact } from 'bytedesk-web/react';
import type { BytedeskConfig } from 'bytedesk-web/react';

Configure Parameters

const config: BytedeskConfig = {
  placement: 'bottom-right',
  marginBottom: 20,
  marginSide: 20,
  bubbleConfig: {
    show: true,
    icon: '👋',
    title: 'Need help?',
    subtitle: 'Click to chat'
  },
  chatParams: {
    org: 'df_org_uid',  // Replace with your organization ID
    t: "2",
    sid: 'df_rt_uid'      // Replace with your SID
  }
};

Use Component

const App = () => {
  const handleInit = () => {
    console.log('BytedeskReact initialized');
  };

  return (
    <div>
      <BytedeskReact {...config} onInit={handleInit} />
      <button onClick={() => (window as any).bytedesk?.showChat()}>
        Open Chat
      </button>
    </div>
  );
};

Available Methods

(window as any).bytedesk?.showChat() - Show chat window
(window as any).bytedesk?.hideChat() - Hide chat window

Run Examples

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

CDN

# https://cdn.jsdelivr.net/npm/bytedesk-web@1.2.7/dist/
https://cdn.jsdelivr.net/npm/bytedesk-web@1.2.7/dist/bytedesk-web.js
https://cdn.jsdelivr.net/npm/bytedesk-web@1.2.7/dist/bytedesk-web.umd.js

Chat SDK

Project Description Forks Stars
iOS-swift iOS swift GitHub forks GitHub Repo stars
Android Android GitHub forks GitHub Repo stars
Flutter Flutter GitHub forks GitHub Repo stars
UniApp Uniapp GitHub forks GitHub Repo stars
Web Web GitHub forks GitHub Repo stars
Wordpress Wordpress GitHub forks GitHub Repo stars
Woocommerce woocommerce GitHub forks GitHub Repo stars
Magento Magento GitHub forks GitHub Repo stars
Prestashop Prestashop GitHub forks GitHub Repo stars
Shopify Shopify GitHub forks GitHub Repo stars
Opencart Opencart GitHub forks GitHub Repo stars
Laravel Laravel GitHub forks GitHub Repo stars
Django Django GitHub forks GitHub Repo stars

Next.js Usage

'use client';

import { BytedeskNextjs } from 'bytedesk-web/nextjs';
import type { BytedeskConfig } from 'bytedesk-web/nextjs';

export default function Page() {
  const config = {
    // ... configuration
  };

  return (
    <div>
      <BytedeskNextjs config={config} />
      <button onClick={() => (window as any).bytedesk?.showChat()}>
        Open Chat
      </button>
    </div>
  );
}

About

bytedesk customer service web chat widget, support vue/react/nextjs/angular/svelte/vanilla/javascript/typescrpt...

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published