SendingNetwork
  • OVERVIEW
    • Getting Started
    • FAQs
  • Network Instructional Articles
    • Basics
      • Introducing the Edge, WatchDog, and Guardian Nodes
      • Overview
      • Messaging Solution
      • Privacy Solution
      • Rich Communication Solution
      • Multi-Platform Solution
      • Decentralized Identity
      • Multiple Chat Modes
      • How It Works
      • Token Utility
      • The Team
    • Key Concepts
      • Decentralized Identity
      • Social Graphs
      • Edge Node
  • SDK Documentation
    • Glossary
    • JavaScript client SDK
      • DID
      • User
      • Message
      • Room
      • Contact
      • Social Graph
    • iOS client SDK
      • Push
      • DID
      • User
      • Message
      • Room
      • Contact
    • Android client SDK
      • User
      • Room
    • Java SDK
      • DID
      • Room
      • Message
    • Node.js SDK
      • DID
      • Room
      • Message
    • Unreal SDK
      • DID
      • User
      • Message
      • Room
    • Unity SDK
      • DID
      • Room
      • Message
    • Website chat widget SDK
      • Customization
      • DID
      • User
      • Room
      • Message
      • Other
    • Bot SDKs
      • Golang Bot SDK
        • DID
        • User
        • Room
        • Message
    • Extensible Message Interface
    • Push Notifications
    • Flutter SDK
      • DID
      • User
      • Message
      • Room
    • PHP SDK
      • DID
      • Room
      • User
    • Developer Key
  • Acquisition Kit
    • Social Boost Development Instructions
  • WatchDog Agent
    • WatchDog Agent Guide
    • WatchDog Agent Deployment Tutorial
      • Linux Deployment Tutorial
    • One-Click Deployment
  • Edge Node
    • Edge Node Deployment Tutorial
    • VPS Setup Guide
      • Google Cloud Platform (GCP)
      • Amazon Web Services (AWS)
      • Contabo
    • Check Node Stats with Auto-Reply Bot in SendingMe App
    • Alpha-3 Testnet FAQs
  • delegation node
    • Delegation Node Deployment Tutorial
  • Private Delegation Node
  • Use Cases
    • Wallet-to-Wallet Messaging
    • Dapp Notifications
    • Identity Verification
    • Gamer Acquisition
    • Cross-platform Trading
Powered by GitBook
On this page
  • Floating Button
  • Add event listeners to the widget
  1. SDK Documentation
  2. Website chat widget SDK

Other

Floating Button

The configuration for the floating button is done through the useWidgetBtn attribute on the chat-component component, which includes two mandatory parameters. The specific configuration is as follows:

  1. pos: 'leftTop' | 'rightTop' | 'leftBottom' | 'rightBottom'; Used to control the relative position of the floating button with respect to the widget. Options include: top-left corner, top-right corner, bottom-left corner, bottom-right corner.

  2. left: '100px'; top: '40px'; Default position of the floating button on the screen.

  3. Parameters are separated by ';', as shown in the example below:

<chat-component useWidgetBtn={'pos:rightBottom;top:800px;left:500px'} />

Add event listeners to the widget

The widget supports event listeners, and when the corresponding events are triggered, the widget will proactively execute the callback functions associated with the listened events. Currently, there are three supported events:

  1. login: Triggered when the user logs in. Callback function does not take any parameters.

  2. logout: Triggered when the user logs out. Callback function does not take any parameters.

  3. unReadCount: Triggered when the number of unread messages changes. Callback function takes the parameter num, which represents the number of unread messages.

Method Name
Description
Parameters
Return Values

window.chatWidgetApi.on

Add event listeners to the widget

type: The type of events above, i.e., "login", "logout", etc. callback: Callback function

N/A

PreviousMessageNextBot SDKs

Last updated 1 year ago