iFlyChat
  • Documentation
  • Installation
    • WordPress Chat Plugin
    • Drupal Chat Module
    • PHP Chat Client
  • WordPress
    • Embed Chatroom in WordPress Post
    • Disable Popup Chat
    • Hide Popup Chat from a Page
    • Embed Inbox View
    • View Chat Logs
    • Guest User Access
    • Show/Hide Popup Chat On Specific Pages
    • WordPress Filters and Hooks
  • API Reference
    • Create a new chat room
    • Retrieve list of all chat rooms
    • Edit a chat room
    • Retrieve list of all online users
    • Kick a user from the chat
    • Retrieve list of all users online in a chat room
    • Delete a chat room
    • Retrieve Thread History
  • JavaScript SDK
    • Quickstart
    • Custom Label In Chat Window
    • User Chat Button Widget
    • Reference
      • message receive
      • message send
      • user list update
      • connect
      • disconnect
      • ready
      • iflychat.startChat
      • iflychat.closeChat
      • iflychat.minimiseChat
      • iflychat.init
      • iflychat.setStatus
      • iflychat.sound
      • iflychat.openAdminDashboard
      • current user status update
      • current user sound update
      • iflychat.renderLabelInChatWindow
  • Help
    • General
      • Introduction
      • Accounts and Billing
      • Chat Theme and Colors
      • Chat Notification Sound
      • Going Offline
      • Change billing card information
    • Embedded Chatroom
      • Create a New Room
      • Create a New Embed Room
      • Embed Room in PHP
    • Feature Description
      • Moderated Chatroom
      • Group Chat
      • Private Embedded Chatroom
      • Change Guest Name
      • Resize Popup Chat Window
      • Mute Sound Notification
      • Change User Status
      • Desktop Notification
      • Popout or Full Screen Mode
      • Share Media Files
      • Video Chat
    • Chat Moderation
      • Kick/Ban/BanIP
      • Delete or Clear Messages
      • Popup Chat Position
      • Popup Chat Launcher Position
      • App Dashboard
      • Emoji Packs
      • Message Display Format
      • Time Display Format
      • Mobile Web Chat
      • Show Only Admins in Chat
      • Hide Recent Chats Section
      • Hide Users in Popup Chat List
      • Hide Popup Chat List
      • Minimize Popup Chat List
Powered by GitBook
On this page

Was this helpful?

  1. JavaScript SDK

Custom Label In Chat Window

Learn how to add a custom label in header or footer inside the chat window

PreviousQuickstartNextUser Chat Button Widget

Last updated 5 years ago

Was this helpful?

You can add a custom label in chat window by using our iFlyChat JavaScript SDK. This would allow you to add your own content inside the chat window either in header or footer. It can be used for declaring chat rules and regulations or for showing advertisements.

We have a function named in JS SDK for this purpose. It takes an object as parameter which should have following properties:

  • id

  • position

  • content

An example is shown below:

window.iflychatAsyncInit = function() {
  
  // All iFlyChat related code should be defined here
  
  /** iFlyChat Init function **/

  iflychat.init({
  
    userlist : {
      visible: true
    }

  });

  /** iFlyChat ready event **/
  iflychat.on('ready', function() {

    var htmlContent = '<div style="padding:2px;">';
    htmlContent += 'This is a custom label above the chat window.';
    htmlContent += '<div style="color:red;">';
    htmlContent += 'You can also customise look and feel.';
    htmlContent += '</div>';
    htmlContent += '</div>'; 
    
    iflychat.renderLabelInChatWindow({ 
      id: 'c-0', 
      position: 'above-chat-content', 
      content: htmlContent 
    }); 
  }); 
};

It will look like this:

Please note that you should be using plan in order to be able to use this feature.

iflychat.renderLabelInChatWindow
Enterprise
iFlyChat - Add custom label in chat window