Jump to: navigation, search

Configuration

Description

WebChat and WebChatService share the configuration namespace '_genesys.widgets.webchat'. WebChat has UI options while WebChatService has connection options.

Example

window._genesys.widgets.webchat = {

	apikey: 'n3eNkgLLgLKXREBMYjGm6lygOHHOK8VA',
	dataURL: 'https://api.genesyscloud.com/gms-chat/2/chat',
	userData: {},
	emojis: true,
	uploadsEnabled: false,
	confirmFormCloseEnabled: true,
	actionsMenu: true,
	maxMessageLength: 140,

	autoInvite: {

		enabled: false,
		timeToInviteSeconds: 10,
		inviteTimeoutSeconds: 30
	},

	chatButton: {

		enabled: true,
		template: '<div class="cx-widget cx-webchat-chat-button cx-side-button" role="button" tabindex="0" data-message="ChatButton" data-gcb-service-node="true"><span class="cx-icon" data-icon="chat"></span><span class="i18n cx-chat-button-label" data-message="ChatButton"></span></div>',
		effect: 'fade',
		openDelay: 1000,
		effectDuration: 300,
		hideDuringInvite: true
	},

	async: {

		enabled: true, 
		newMessageRestoreState: 'minimized', 

		getSessionData: function(sessionData, Cookie, CookieOptions) {

			// Note: You don't have to use Cookies. You can, instead, store in a secured location like a database.

			Cookie.set('customer-defined-session-cookie', JSON.stringify(sessionData), CookieOptions);
		},

		setSessionData: function(Open, Cookie, CookieOptions) {

			// Retrieve from your secured location.

			return Cookie.get('customer-defined-session-cookie');
		}
	},

	minimizeOnMobileRestore: false,

	markdown: false,

	ariaIdleAlertIntervals:[50,25,10],

	ariaCharRemainingIntervals:[75, 25, 10]
};

Options

Name Type Description Default Required Introduced / Updated
emojis boolean Enable/disable Emoji menu inside chat message input. Emojis are supported using unicode characters and the list includes ☺ U+263A (smile), 👍 U+1F44D (thumbs up) and ☹ U+2639 (sad). false n/a
form object An object containing a custom registration form definition. The definition placed here becomes the default registration form layout for WebChat. See Customizable Chat Registration Form. A basic registration form is defined internally by default n/a
uploadsEnabled boolean Show/Hide the Send File button. The button will be shown if the value is set to true. false n/a
confirmFormCloseEnabled boolean Enable or disable displaying a confirmation message before closing WebChat if information has been entered into the registration form. true n/a
timeFormat number/string This sets the time format for the timestamps in this widget. It can be 12 or 24. 12 false
actionsMenu boolean Enable/disable actions menu next to chat message input. true n/a
maxMessageLength number Set a character limit that the user can input into the message area during a chat. When max is reached, user cannot type any more. 500 n/a
charCountEnabled boolean Show/Hide the number of characters remaining in the input message area while the user is typing. false n/a
autoInvite.enabled boolean Enable/disable auto-invite feature. Automatically invites user to chat after user idles on page for preset time.
Important
In case of running Widgets in lazy load mode, this option requires WebChat plugin to be pre-loaded.
false n/a
autoInvite.timeToInviteSeconds number Number of seconds of idle time before inviting customer to chat. 5 n/a
autoInvite.inviteTimeoutSeconds number Number of seconds to wait, after showing invite, before closing chat invite.
Important
When the focus is on the Invite window, the chat invite will not auto close upon the specified timeout. In this scenario, you must click the Close button to manually close the Invite window. This is to support the logical and predictable focus order as recommended by WCAG 2.4.3:Focus Order.
30 n/a
chatButton.enabled boolean Enable/disable chat button on screen.
Important
In case of running Widgets in lazy load mode, this option requires WebChat plugin to be pre-loaded.
false n/a
chatButton.template string Custom HTML string template for chat button.
<div class="cx-widget cx-webchat-chat-button cx-side-button" role="button" tabindex="0" data-message="ChatButton" data-gcb-service-node="true"><span class="cx-icon" data-icon="chat"></span><span class="i18n cx-chat-button-label" data-message="ChatButton"></span></div>
n/a
chatButton.effect string Type of animation effect when revealing chat button. 'slide' or 'fade'. fade n/a
chatButton.openDelay number Number of milliseconds before displaying chat button on screen. 1000 n/a
chatButton.effectDuration number Length of animation effect in milliseconds. 300 n/a
chatButton.hideDuringInvite boolean When auto-invite feature is activated, hide the chat button. When invite is dismissed, reveal the chat button again. true n/a
async object Object container for Async mode configuration options. {enabled: false, newMessageRestoreState: 'full'} Yes, if using Async mode 9.0.002.06
async.enabled boolean Enable Asynchronous Chat where a chat session can be active indefinitely. When you close WebChat without ending the chat session, the session will simply go dormant. When you open WebChat again, the session will restore and continue chatting where left off. Currently, Async Chat is supported only in cometD mode and it should be enabled. false n/a 9.0.002.06
async.newMessageRestoreState string Determines how WebChat should be displayed when a new message arrives if WebChat is closed. Accepted values are 'full' and 'minimized'. 'full' means WebChat appears on screen displaying new messages in the transcript area as a new message arrives. 'minimized' means WebChat opens in a minimized state along with a counter in the title bar area indicating how many new messages are present. full n/a 9.0.002.06
async.getSessionData function A function that you can define to retrieve updated session data from WebChatService plugin over the course of an active chat session. This function takes the following arguments - sessionData (current active session data), Cookie (Widgets Internal cookie reference) and CookieOptions (a parameter that is needed when using Widgets Cookie). The purpose of this function is to provide you the active session data so that it can be stored somewhere safe and secure. Later this needs to be provided in the below setSessionData function to restore the chat session. Refer to the example for usage. none Yes, when Async WebChat mode is enabled 9.0.002.06
async.setSessionData function A function that you can define to return the session data to WebChat plugin. During initialization, WebChatService plugin will call this function to check if any session data is returned. If found, WebChatService tries to restore the chat session using this session data and open WebChat Widget. WebChatService will also pass the following arguments into this function - Open (WebChat current open state value), Cookie (Widgets Internal cookie reference) and CookieOptions (a parameter that will be needed when using Widgets Cookie). Refer to the example for usage. none Yes, when Async WebChat mode is enabled 9.0.002.06
minimizeOnMobileRestore boolean Enable/disable the minimized state of webchat on chat restore.
Important
This option is only for mobile mode.
false n/a 9.0.013.02
markdown boolean Enable/disable the markdown feature for chat messages. false n/a 9.0.014.02
ariaIdleAlertIntervals array/boolean An array containing the intervals as a percentage at which the screen reader will announce the remaining idle time. By default, it is enabled with the following time intervals, and it is customizable according to the user's needs. Configuring a value of 'false' will let the screen reader call out idle time for every change. [100, 75, 50, 25, 10] n/a 9.0.016.11
ariaCharRemainingIntervals array/boolean An array containing the intervals as a percentage at which the screen reader will announce the remaining characters when the user inputs text into the message area. By default, it is enabled with the following intervals, and it is customizable according to the user needs. Configuring a value of 'false' will let the screen reader call out remaining characters for every change. [50, 25, 10] n/a 9.0.016.11
metaDataEnabled boolean Enable or disable WebChat MetaData. true n/a 9.0.017.26
enableUrlTrailingSlash boolean Enable or disable trailing slash at the end of the dataURL when the start chat connection request is sent to the server.
Important
This option is applicable for REST mode only.
true n/a 9.0.017.28
This page was last edited on December 15, 2021, at 15:09.
Comments or questions about this documentation? Contact us for support!