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
  • Third-Party login
  • Visibility
  1. SDK Documentation
  2. Website chat widget SDK

Customization

Third-Party login

window.chatWidgetApi.thirdDIDLogin(address, thirdSignFunc, callBack)
Method Name
Description
Parameters
Return Values

window.chatWidgetApi.thirdDIDLogin

Inject login status

address: user wallet address;

thirdSignFunc: Third party signer, eg. thirdSignFunc({ message});

callback: callback function after successful login

N/A

  1. First, set useThirdLogin on the widget component: <chat-component useThirdLogin={true} />.

  2. Call this API and provide the necessary parameters after the component has mounted, such as using useEffect, ComponentDidMount in React, or mounted in Vue. The address parameter represents the wallet address of the logged-in user (required), and thirdSignFunc is the signing function (required). When the API internally calls the thirdSignFunc signing function, it will pass the parameter message. thirdSignFunc should use this message to trigger wallet signing and return the result of the signature. The thirdDIDLogin API will wait for thirdSignFunc to complete and return, and then proceed with the login logic. Pseudocode example:

thirdDIDLogin(address, thirdSignFunc, callback) {
    // Use address to call the the API and retrieve the corresponding DID.
    const sign = await thirdSignFunc({message});
    // Call didLogin(sign, ...otherParams) to perform the login.
    // Upon successful login, call callback();
}
  1. The callback parameter is optional and can be used as needed. It will be invoked regardless of whether the login is successful or not. For a successful login, call callback(true), and for a failed login, call callback(false).

Visibility

window.chatWidgetApi.showWidget(isShow)
Method Name
Description
Parameters
Return Values

window.chatWidgetApi.showWidget

Control Widget Visibility

isShow (required): Specifies whether the widget should be displayed. [Type]: Boolean

N/A

PreviousWebsite chat widget SDKNextDID

Last updated 1 year ago