Revision as of 16:59, June 7, 2019 by Jumunn (talk | contribs) (Update with the copy of version: Public)
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.

Important
Starting 9.0.008.04 version, WebChatService allows you to choose between the types of chat services available in Genesys via the transport section configuration options.

Example

// When using GMS API 

window._genesys.widgets.webchat = {

	apikey: 'n3eNkgxxxxxxxxxxxx8VA',
	dataURL: 'https://api.genesyscloud.com/gms-chat/2/chat',
	enableCustomHeader: true,

	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
	}
};

// When using PureEngage v3 API

window._genesys.widgets.webchat = {

	emojis: true,
	userData: {},
	transport: {

		type: 'pureengage-v3-rest',
		dataURL: https://<hostname>/nexus/v3/chat/sessions,
		endpoint: 'xxxxxxxxx',
		headers: {
			'x-api-key': 'xxxxxxxx'
		},
		async: {

			enabled: true, 

			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');
			}
		},

	chatButton: {

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

Options

WebChat with GMS API

Name Type Description Default Required Introduced / Updated
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 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
enableCustomHeader boolean Enables the use of the custom authorization header defined in _genesys.widgets.main.header static config. Attaches the custom authorization header to all WebChatService request. false No 9.0.002.06
userData object Arbitrary attached data to include when initiating a chat. {} n/a
ajaxTimeout number Number of milliseconds to wait before AJAX timeout. 3000 n/a
xhrFields object Allows you to set the properties for the AJAX xhrFields object (for example, {withCredentials: false}). {withCredentials: false} n/a
pollExceptionLimit number Number of successive poll exceptions (chat server offline) before WebChatService publishes 'chatServerWentOffline'. 5 n/a
restoreTimeout 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). 60000

WebChat with PureEngage v3 API

Name Type Description Default Required Introduced / Updated
transport object Object containing the transport service configuration options. n/a Yes, when using new transport services available with WebChat. 9.0.008.04
transport.type string Select the type of transport service that needs to work with WebChat UI plugin. For Pure Engage v3 REST API, the value is 'pureengage-v3-rest'. n/a Yes, when using Pure Engage v3 REST API. 9.0.008.04
transport.dataURL string (URL) URL for Pure Engage v3 REST API chat service. Please contact your local Genesys customer representative to obtain a valid dataURL. n/a Always 9.0.008.04
transport.endpoint string The endpoint for PureEngage v3 API. n/a Yes 9.0.008.04
transport.headers object Object containing key value pairs of any custom headers. n/a Yes 9.0.008.04
transport.headers[x-api-key] string The API key provided from Genesys. Please contact your local Genesys customer representative to obtain a valid API key. n/a Yes 9.0.008.04
transport.async object Object containing Async mode configuration options.

Note: To properly restore a Chat session that was ended previously, you'll need to navigate back to the page and open the WebChat Widget. This way, the Chat session is restored in the background and is ready. At present time, this is a current limitation in Async WebChat.

{} Yes, when using Async mode 9.0.008.04
transport.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. false Yes, when Async WebChat mode is enabled 9.0.008.04
transport.async.setSessionData function A function that you can define to retrieve updated session data from WebChatService plugin. This function is called back when starting a new Async chat session for the first time or when the sessionData changes 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.008.04
transport.async.getSessionData function A function that you can define to return the session data to WebChatService 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.008.04
userData object Arbitrary attached data to include when initiating a chat. {} n/a
ajaxTimeout number Number of milliseconds to wait before AJAX timeout. 3000 n/a

Comments or questions about this documentation? Contact us for support!