Table of contents
Description
Displays a Chat plugin. The Chat plugin enables users to chat and share activities in real time, making it appropriate for online live events.
The user interface is comprised of a user panel and two chat tabs:
- Top panel - enables users to Sign-in using social network accounts to begin chatting.
- Everyone tab - shows live chat items publicly shared by all chat users in the event. Users can choose whether they want to share their messages with everyone or just with their friends.
- My Friends tab - Shows the messages shared by friends from one or more Social Networks.
Plugin's Default Design:

The plugin's design is customizable through the use of the parameters listed below. For advanced customization options and plugin style (CSS) adjustments, please consult Gigya's support team. You can contact us by filling in a support form on our site. You can also access the support page by clicking "Support" on the upper menu of Gigya's site.
Syntax
gigya.socialize.showChatUI(params)
Method Parameters
The following table lists the params object members:
| Required | Name | Type | Description |
| Required | containerID | string | An ID of a <DIV> element on the page in which you want to display the plugin. |
| categoryID | integer | Each Chat plugin instance has an ID. Before embedding a Chat plugin in your site, you are required to create at least one chat in the Chat Setup page on Gigya's website. When creating a new chat, a unique ID is created. The generated 'Embed code' includes this category ID. You can use this code to embed the Plugin in your site. Note: The Chat Setup page is visible only if your Chat plugin has been activated by Gigya. | |
| Optional | streamID | string | You may declare multiple streams on the same category ID. Set this parameter with a unique ID of your choice to identify a stream. The default value of this parameter is "0". Note: the string is limited to 150 characters and is case-sensitive. |
| width | integer | Determines the width you desire for the plugin. | |
| height | integer | Determines the height you desire for the plugin. | |
| skin | string | The ID of the skin to display for the chat plugin. If you set this parameter, it will override the chat skin that was defined for this chat instance.. | |
| linkText | string | The title of the chat, which will be published to the connected social networks along with the chat message. The value of this parameter overrides the content of the "Title" text box in the 'Published message options' section of the Chat Setup page on Gigya's website. | |
| linkURL | string | The linkback for the chat, which will be published to the connected social networks along with the chat message. The value of this parameter overrides the content of the "Link URL" text box in the 'Published message options' section of the Chat Setup page on Gigya's website. | |
| limitDisplayMessages | integer | The maximum number of chat messages to display in the chat UI. The default value is 50. | |
| readOnly | Boolean | Setting this parameter to "true" changes the chat status to read only mode, where the users will only be able to read the chat messages but not add to them. The value of this parameter overrides the "Read Only" check box set in the Chat Setup page on Gigya's website. | |
| dateFormat | string | The format of the date. The days, months, and years can be represented as follows:
For example: dateFormat: "%d/%M/%yy" - > 29/5/12, or dateFormat: "%MMMM %d, %yyyy" - > May 29, 2012. | |
| userAction | userAction object | When a user writes a chat message, the post may be published to one or more social networks. Using this parameter you may customize the feed published to the social networks. The User Message field of the userAction object should be the chat message, and the rest of the userAction object fields can be set by the partner. | |
| cid | string | A string of maximum 100 characters length. This string is associated with each transaction and will later appear on reports generated by Gigya in the "Context ID" combo box. The cid allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. The "Context ID" combo box lets you filter the report data by site/application context. Note: the value of this parameter overrides the value of the identical parameter in the global configuration object. | |
| actionAttributes | JSON object | In Gamification your users receive points for actions they perform on your site, in this case posting a mesage grants the user points. Action Attributes may be used to annotate actions with additional information, such as the section of the web site that generated the action. If you set here the actionAttributes, each time a user posts a message, the action also receives an attribute, for example "tv-show":"glee", which can mean that the action was performed on the "Glee" page of the site. These action attributes are later used to display the GM Plugins filtered according to a certain attribute. For example, you can show the Leaderboard plugin only for top users on the "Glee" page. This parameter receives a JSON object, comprised of a set or sets of a key (category) and a value or values, i.e.: "tv-show": ["glee", "30rock"], |
Global Event Triggered
By using this plugin, the following global event may be triggered: onLogin, onConnectionAdded and onConnectionRemoved.
To register an event handler use the socialize.addEventHandlers API method. Please refer to the Events page in the Developer Guide - to learn more about how to handle events generated by the Gigya service.
Code Sample
var params = {
containerID: "divChat", // The component will embed itself inside the divConnect Div
categoryID:3042004, // Insert here the categoryID obtained from the chat setup
width:300,
height:450,
cid:'chat demo' //context id to tag data
};
gigya.socialize.showChatUI(params); - This sample is not meant to be fully functional code. For brevity's sake, only the code required for demonstrating the API call itself is presented.
- To run the code on your own domain, add your Gigya API key to the socialize.js URL. A Gigya API key can be obtained on the Site Dashboard page on Gigya's website. Please make sure that the domain from which you are loading the page is the same domain name that you used for generating the API key.
In the Chat Plugin demo you will find a complete working example which uses the socialize.showChatUI method. You may view the code, run it and view the outcome.

Comments