Jump to: navigation, search
(Update with the copy of version: draft)
(Update with the copy of version: draft)
Line 1: Line 1:
 
= Configuration =
 
= Configuration =
__NOTOC__
 
 
== Description ==
 
== Description ==
 
WebChat and WebChatService share the configuration namespace '_genesys.widgets.webchat'. WebChat has UI options while WebChatService has connection options.
 
WebChat and WebChatService share the configuration namespace '_genesys.widgets.webchat'. WebChat has UI options while WebChatService has connection options.
 
 
== Example ==
 
== Example ==
 
<pre>
 
<pre>
Line 10: Line 8:
 
apikey: 'n3eNkgLLgLKXREBMYjGm6lygOHHOK8VA',
 
apikey: 'n3eNkgLLgLKXREBMYjGm6lygOHHOK8VA',
 
dataURL: 'https://api.genesyscloud.com/gms-chat/2/chat',
 
dataURL: 'https://api.genesyscloud.com/gms-chat/2/chat',
cometD: false,
+
 
 +
cometD: {
 +
 
 +
enabled: false,
 +
cometURL: 'http://host:port/genesys/cometd',
 +
channel: '/service/chatV2/customer-support',
 +
websocketEnabled: true,
 +
logLevel: 'info'
 +
},
 +
 
 
userData: {},
 
userData: {},
 
emojis: true,
 
emojis: true,
Line 50: Line 57:
 
| endpoint
 
| endpoint
 
| string
 
| string
| Manually select the endpoint to initiate the chat on.
+
| Manually select the endpoint to initiate chat on.
 
| n/a
 
| n/a
 
|  
 
|  
 
|-
 
|-
 
| dataURL
 
| dataURL
| URL String
+
| string (URL)
| URL of GMS server.
+
| URL for GMS REST chat service. If cometD.enabled is set to true, this property will be ignored.
 
| n/a
 
| n/a
 
| Always
 
| Always
 
|-
 
|-
 
| cometD
 
| cometD
 +
| object
 +
| Object container for CometD configuration options.
 +
| {enabled: false, cometURL: '', channel: '/service/chatV2/customer-support', websocketEnabled: true, logLevel: 'info'}
 +
| Yes, if using CometD
 +
|-
 +
| cometD.enabled
 
| boolean
 
| boolean
| Enable or disable CometD using Websockets or Long-polling.
+
| Enables or disables CometD connection method. If set to false or left undefined, WebChatService will connect to REST services through the dataURL specified.
 
| false
 
| false
 +
| Yes, if using CometD
 +
|-
 +
| cometD.cometURL
 +
| string (URL)
 +
| URL for GMS CometD connection. cometD.enabled must be set to true for WebChatService to connect to this service.
 +
| n/a
 +
| Yes, if using CometD
 +
|-
 +
| cometD.channel
 +
| string (path)
 +
| CometD channel for receiving chat messages.
 +
| '/service/chatV2/customer-support'
 +
| Yes, if using CometD
 +
|-
 +
| cometD.websocketEnabled
 +
| boolean
 +
| If set to true, CometD will attempt to connect through websockets. If set to false, CometD will only use long-polling. CometD will fallback to long-polling if it can't connect via websockets.
 +
| true
 +
|
 +
|-
 +
| cometD.logLevel
 +
| string
 +
| Sets the log level for the CometD library. Values are 'warn', 'info', or 'debug'.
 +
| 'info'
 
|  
 
|  
 
|-
 
|-
Line 80: Line 117:
 
| xhrFields
 
| xhrFields
 
| object
 
| object
| Allows you to set the properties for the AJAX xhrFields object (for example {withCredentials: false}).
+
| Allows you to set the properties for the AJAX xhrFields object (e.g. {withCredentials: false}).
 
| {withCredentials: false}
 
| {withCredentials: false}
 
|  
 
|  
Line 92: Line 129:
 
| restoreTimeout
 
| restoreTimeout
 
| number
 
| number
| Number of milliseconds before restore timeout. Prevents the chat session from restoring after a certain time away from the session (for example user navigated to a different site during chat and never ended the session).
+
| Number of milliseconds before restore timeout. Prevents the chat session from restoring after a certain time away from the session (e.g. user navigated to a different site during chat and never ended the session).
 
| 60000
 
| 60000
 
|  
 
|  

Revision as of 16:04, October 11, 2017

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',

	cometD: {

		enabled: false,
		cometURL: 'http://host:port/genesys/cometd',
		channel: '/service/chatV2/customer-support',
		websocketEnabled: true,
		logLevel: 'info'
	},

	userData: {},
	emojis: true,
	actionsMenu: true,

	autoInvite: {

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

	chatButton: {

		enabled: true,
		template: '<div>CHAT NOW</div>',
		effect: 'fade',
		openDelay: 1000,
		effectDuration: 300,
		hideDuringInvite: true
	}
};

Options

Name Type Description Default Required
apikey string Apigee Proxy secure token. n/a Yes, if using Apigee Proxy
endpoint string Manually select the endpoint to initiate chat on. n/a
dataURL string (URL) URL for GMS REST chat service. If cometD.enabled is set to true, this property will be ignored. n/a Always
cometD object Object container for CometD configuration options. {enabled: false, cometURL: , channel: '/service/chatV2/customer-support', websocketEnabled: true, logLevel: 'info'} Yes, if using CometD
cometD.enabled boolean Enables or disables CometD connection method. If set to false or left undefined, WebChatService will connect to REST services through the dataURL specified. false Yes, if using CometD
cometD.cometURL string (URL) URL for GMS CometD connection. cometD.enabled must be set to true for WebChatService to connect to this service. n/a Yes, if using CometD
cometD.channel string (path) CometD channel for receiving chat messages. '/service/chatV2/customer-support' Yes, if using CometD
cometD.websocketEnabled boolean If set to true, CometD will attempt to connect through websockets. If set to false, CometD will only use long-polling. CometD will fallback to long-polling if it can't connect via websockets. true
cometD.logLevel string Sets the log level for the CometD library. Values are 'warn', 'info', or 'debug'. 'info'
userData object Arbitrary JSON attached data to include when initiating a chat. {}
ajaxTimeout number Number of milliseconds to wait before AJAX timeout. 3000
xhrFields object Allows you to set the properties for the AJAX xhrFields object (e.g. {withCredentials: false}). {withCredentials: false}
pollExceptionLimit number Number of successive poll exceptions (chat server offline) before WebChatService publishes 'chatServerWentOffline'. 5
restoreTimeout number Number of milliseconds before restore timeout. Prevents the chat session from restoring after a certain time away from the session (e.g. user navigated to a different site during chat and never ended the session). 60000
Comments or questions about this documentation? Contact us for support!