This readme provides information regarding the sample provided here and the differences with the ODA Native Client SDK for Web.
Web Chat For Service 24D is based on Oracle Digital Assistant Native Client SDK for Web release 24.10.
The files index.html and settings.js are sample files provided to be able to easily start using WCFS.
The function initSdk can receive parameters to customize the connection and the pre-launch form behavior:
name
Name by which the chat widget should be referred, defaults to BotsshowPreLaunchForm
always(default) | never | initial, see Pre-launch Form for more detailsconnectionData
connectionData setting key values, see Connection Data for more detailsExamples
<script src="scripts/wcfs-sdk.js" onload="initSdk()" defer></script>
<script src="scripts/wcfs-sdk.js" onload="initSdk('Bots')" defer></script>
<script src="scripts/wcfs-sdk.js" onload="initSdk('Bots', 'initial')" defer></script>
<script src="scripts/wcfs-sdk.js" onload="initSdk('Bots', 'always', {'subject': 'help', customfields: [{name: 'my_text_customfield', value: 'some value'}]})" defer></script>
<script src="scripts/wcfs-sdk.js" onload="initSdk('Bots', 'never', {'subject': 'help', 'email': 'test@test.com'})" defer></script>
The following setting
keys are specific to WCFS:
Key | Default Value | Description |
---|---|---|
agentNameMode | fullName | Remove or customize the name of the agent in the conversation, see Bot and Agent Name Customization for more details |
attachmentMode | agent | When to show the share file menu item, see File and Location Sharing for more details |
attachmentSettings | File upload and download settings, see File and Location Sharing for more details | |
authorization | A Fusion JWT can be given to start a chat for an authenticated user, see Authorization | |
botNameMode | noName | Add and customize the name of the bot in the conversation, see Bot and Agent Name Customization for more details |
botNames | [ ] | An array of bot names to differentiate them from agents in the UI, when not set the bot will look like an agent (avatar, etc...). This is not needed anymore if the Chat Server is running version 23.02 or greater |
clearConversationOnClose | true | Whether to clear or keep the conversation when the widget is closed, see End Conversation for more details |
conditionalChatLinkCss | Customize the CSS of the conditional chat link, see Conditional Chat Link for more details | |
conditionalChatLinkElementId | The ID of the element where to append the conditional chat link, see Conditional Chat Link for more details | |
conditionalLaunchButton | off | Set a condition to display the launch button, see Conditional Launch Button for more details |
conditionalLaunchButtonDetails | Condition settings when enabling conditionalLaunchButton , see Conditional Launch Button for more details |
|
connectionData | Standard attributes that can be set before starting a conversation, see Connection Data for more details | |
disableAgentTypingIndicator | false | When the typing indicator is enabled (showTypingIndicator ), only disable the agent typing indicator |
disconnectEvent | beforeunload | Set which event will handle the disconnect when leaving, closing or reloading the page, see Persistence for more details |
enableAgentAttachment | true | Allow the agent to send attachments to WCFS |
enableClientGreetingAgent | false | Use a client greeting for the agent instead of the server side one, see Bot and Agent Client Greeting for more details |
enableClientGreetingBot | false | Use a client greeting for the bot instead of the server side one, see Bot and Agent Client Greeting for more details |
enableConditionalChatLink | false | Show a chat link when conditions are met, see Conditional Chat Link for more details |
enableDraggableWidget | false | Allows you to drag the chatwindow on the webpage |
enableEndConversationButtonToClose | false | Enable the end conversation button to also close the widget when there is no active connection, see End Conversation for more details |
enableLocation | false | Enables sharing the location, see File and Location Sharing for more details |
enableOffTheRecord | false | Enable an "off the record" button in the chat header, see Off the Record and Sensitive Information for more details |
enablePlfSecurity | true | Secure the pre-launch form by preventing it to be manipulated |
enablePostConversationMessage | false | Show a custom message after the conversation has ended, see Post Conversation Message for more details |
enableProactiveChat | false | Show a chat invite dialog when conditions are met, see Proactive Chat for more details |
launchButtonSettings | Additional customization for the launch button, see Additional Launch Button Settings for more details | |
maskingCharacter | # | Customize the masking character, see Off the Record and Sensitive Information for more details |
maskingMode | full | Customize the masking mode (full or partial), see Off the Record and Sensitive Information for more details |
maskingPatterns | [ ] | Enable sensitive information detection by providing patterns to send it masked, see Off the Record and Sensitive Information for more details |
offTheRecordPatterns | [ ] | Enable sensitive information detection by providing patterns to send the message off the record, see Off the Record and Sensitive Information for more details |
persistence | true | Stores the session data in session storage to restore the conversation when navigating back or reloading, see Persistence for more details |
persistenceOpenWidget | true | When navigating back automatically open the widget and restore the conversation (Requires persistence to be enabled) |
persistenceTimeout | 0 | Timeout in seconds after which WCFS will not try to restore the session when navigating back, 0 disables it |
postConversationMessageOptions | Configure what type of post conversation message to show, see Post Conversation Message for more details | |
preLaunchFormFields | Customise standard attributes to show as fields in the pre-launch form, see Pre-launch Form for more details | |
printStyles | The styles for printing which are injected as a @media print rule, see Conversation Printing for more details | |
proactiveChatDialogCss | Customize the proactive chat dialog, see Proactive Chat for more details | |
proactiveChatUrl | Launch a page based upon the URL defined instead of opening the widget on the same page, see Proactive Chat for more details | |
sanitizeHtml | true | Sanitize all incoming messages to prevent cross site scripting (removing all dangerous tags and properties from the incoming html) |
service | B2C | Whether the service is FUSION or B2C |
showPageLeaveWarning | false | When a conversation has been started the default browser's leave page message will be shown when navigating away or reloading, this feature will not work when disconnectEvent has been set to beforeunload |
showPreLaunchForm | always | always or initial or never, see Pre-launch Form for more details |
showSystemMessageMinimizeButton | true | Show the minimize widget button when a system or post conversation message is shown |
showSystemMessageStartButton | true | Show the start new conversation button when a system or post conversation message is shown" |
showWidgetTimeout | 0 | Timeout for the widget to appear on the screen in milliseconds |
showWidgetTimeoutInactivity | false | Weather the timeout is based on the page load or on inactivity |
splitText | off | Enable the possibility to split long messages, see Message Text Splitting for more details |
splitTextSettings | Configure how to split messages Message Text Splitting | |
waitQueueMessageDelay | 1 | Delay in seconds before showing the wait queue message |
Changing or using the following setting
keys are currently not supported by WCFS:
channelId
clientAuthEnabled
userId
enableAttachmentSecurity
enableAutocomplete
enableAutocompleteClientCache
enableCancelResponse
enableDefaultClientResponse
enableHeadless
enableLongPolling
enableSpeech
enableSpeechAutoSend
enableTabsSync
linkHandler
multiLangChat
shareMenuItems
(see File and Location Sharing for more details)speechLocale
ttsService
webViewConfig
defaultGreetingTimeout
enableLocalConversationHistory
initMessageOptions
initUserHiddenMessage
messageCacheSizeLimit
showPrevConvStatus
storageType
useCreatedOnTimestamp
The following setting
keys can be updated after WCFS has been initialized:
connectionData
See Connection Data for more details.
preLaunchFormFields
See Pre-launch Form for more details.
conditionalLaunchButtonDetails
See Conditional Launch Button for more details.
position
Use the updatePosition
method the same way you would set the position
setting key. Omitted position attributes will not be updated.
Note that the position setting
key sets the bottom right point of the widget.
For example, considering that the default position is:
position: {
top: '',
bottom: '20px',
left: '',
right: '20px'
}
The following will move the widget 80 pixels to the left:
Bots.updatePosition({
right: '100px'
});
See the ODA Native Client SDK for Web for more details about the position
setting key.
The following custom text
keys are specific to WCFS:
Key | Default Value | Description |
---|---|---|
agentAbsentMessage | The agent you were talking with is having connectivity problems. Please give us some time to resolve the problem. | Message that appears when the agent is having connectivity problems |
agentAttachmentDownloaded | The agent has shared this file: {0} ({1} KB). | Message shown when the attachment sent by the agent has completed, {0} - file name; {1} - file size |
agentAttachmentDownloading | The agent is sending you file {0} ({1} KB), please wait. | Message shown when the agent is sending a file, {0} - file name; {1} - file size |
agentAttachmentDownloadFailed | Processing the download has failed: {0} ({1} KB). | Message shown when a download has failed, {0} - file name; {1} - file size |
agentLeftChatMessage | {0} has left the chat. | Message shown when a bot or agent leaves the chat, {0} can be replaced by the name |
bot | Bot | The name of the bot when botNameMode is set to defaultName , see Bot and Agent Name Customization for more details |
clientGreetingAgent | Hello, my name is {0}, how can I help you? | Agent client greeting where {0} can be replaced by the name of the agent, see Bot and Agent Client Greeting for more details |
cclLinkAriaLabel | Chat with a live agent | The aria-label of the conditional chat link |
cclLinkText | Live Chat | The text of the conditional chat link |
clientGreetingBot | Hello, I'm chatbot {0}, how can I help you? | Bot client greeting where {0} can be replaced by the name of the bot, see Bot and Agent Client Greeting for more details |
endConversationAndClose | Close widget | The label of the end conversation button when enableEndConversationButtonToClose is enabled, see End Conversation for more details |
holidayMessage | It is currently a holiday. | Connection error message when it is a holiday |
launchButtonText | Want to Chat? | When set this text will display in the launch button |
locationSharedMessage | The location has been shared: {0}, {1} | Message sent to the agent when the location is shared, {0} - location latitude; {1} - location longitude |
networkWarningMessage | Trying to recover from an unexpected network issue. | Warning message shown when the user is experiencing network issues |
noAgentsMessage | There are no agents available to chat with you right now. Please try again later. | Connection error message when no agents are available |
offTheRecordOffButtonLabel | Disable off the record | Label on the "off the record" button when it can be used to turn off "off the record" |
offTheRecordOffMessage | The following messages are recorded | Message that appears when "off the record" chatting is turned off |
offTheRecordOnButtonLabel | Enable off the record | Label on the "off the record" button when it can be used to turn on "off the record" |
offTheRecordOnMessage | The following messages are off the record | Message that appears when "off the record" chatting is turned on |
outOfHoursMessage | You are currently trying to access a chat agent outside available chat hours. Please try again later. | Connection error message when out of office hours |
plfApplicationClassificationLabel | Application classification | Pre-launch form applicationClassification attribute field label |
plfAssigneeIdLabel | Assignee | Pre-launch form assigneeId attribute field label |
plfBadEmailMessage | Provide a valid email address | Pre-launch form invalid email address error message |
plfBusinessUnitOrgIdLabel | Business Unit | Pre-launch form businessUnitOrgId attribute field label |
plfCancelChatLabel | Cancel | Pre-launch form cancel connect button label message |
plfCategoryIdLabel | Product Category | Pre-launch form categoryId attribute field label |
plfChatPriorityLabel | Chat Priority | Pre-launch form chatPriority attribute field label |
plfContactIdLabel | Contact | Pre-launch form contactId attribute field label |
plfEmailLabel | Pre-launch form email attribute field label |
|
plfFirstNameLabel | First Name | Pre-launch form firstName attribute field label |
plfFooterHtml | Pre-launch form footer custom HTML, for more information see Header And Footer | |
plfHeaderHtml | Pre-launch form header custom HTML, for more information see Header And Footer | |
plfIncidentSeverityCodeLabel | Incident Severity | Pre-launch form incidentSeverityCode attribute field label |
plfIncidentTypeLabel | Incident Type | Pre-launch form incidentType attribute field label |
plfInventoryItemIdLabel | Inventory Item | Pre-launch form inventoryItemId attribute field label |
plfInventoryOrgIdLabel | Inventory Organization | Pre-launch form inventoryOrgId attribute field label |
plfLastNameLabel | Last Name | Pre-launch form lastName attribute field label |
plfProductGroupIdLabel | Product Group | Pre-launch form productGroupId attribute field label |
plfProductIdLabel | Product | Pre-launch form productId attribute field label |
plfOrganizationIdLabel | Organization | Pre-launch form organizationId attribute field label |
plfQueueIdLabel | Queue | Pre-launch form queueId attribute field label |
plfRequiredFieldMessage | Provide a value for this field | Pre-launch form required field error message |
plfServiceRequestNumberLabel | Service Request | Pre-launch form serviceRequestNumber attribute field label |
plfStartChatLabel | Start Chat | Pre-launch form start chat button label message |
plfStripeCodeLabel | Stripe Code | Pre-launch form stripeCode attribute field label |
plfSubjectLabel | Subject | Pre-launch form subject attribute field label |
postConversationMessage | Please take this survey to help us improve. | Message shown when enablePostConversationMessage is enabled |
postConversationMessageLinkButtonLabel | Take Survey | The label of the link button when enablePostConversationMessage is enabled as link type |
postConversationPrintButtonLabel | Print Conversation | The label of the print conversation button |
pacDialogTextHtml | \<p>An agent is available to chat.\</p>\<p>Would you like to start a chat session?\</p> | The main text of the proactive chat dialog |
pacDialogTitleHtml | \<p>\<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 24 24">\<path d="M3.6 21H3c-.6 0-1-.4-1-1V5c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H8.8c-.5 0-1 .2-1.4.6l-3.1 3.1c-.2.2-.4.3-.7.3zM4 5v13.2l2-2c.8-.8 1.8-1.2 2.8-1.2H20V5z" fill="#161513"/>\</svg>\<span style="font-weight: bold; font-size: large; vertical-align: top;"> Live Chat\</span>\</p> | The title of the proactive chat dialog |
pacNoButtonLabel | No | The label of the button to discard the proactive chat |
pacYesButtonLabel | Yes | The label of the button to accept the proactive chat |
queueWaitMessage | Queueing\nPosition in queue: {0}\nAverage wait time: {1}\nExpected wait time: {2} | The message shown when the user is waiting in a queue, {0} - Position; {1} Average wait time; {2} Expected wait time |
sensitiveInformationMessage | Sensitive information has been found | The message that appears above the user's message that contains the sensitive information |
sensitiveInformationMaskingMessage | Your message has been masked | The message that appears after sensitiveInformationMessage to indicate that the message has been masked |
sensitiveInformationOffTheRecordMessage | Your message has been sent off the record | The message that appears after sensitiveInformationMessage to indicate that the message has been sent off the record |
sensitiveInformationRemovedMessage | This message has been removed | The message that replaces in WCFS the user's message that contains the sensitive information |
sessionEndedAbnormallyMessage | Something went wrong and this conversation has ended. | Message that appears when the chat session has abnormally ended |
sessionEndedByAgentConcludedMessage | The agent has concluded this conversation. | Message that appears when the agent concludes the chat |
sessionEndedByQueueTimeoutMessage | The queue waiting time has expired. | Message that appears when the chat session has timed out while waiting in the queue |
sessionEndedByTimeoutMessage | This conversation has timed out. | Message that appears when the chat session has timed out while being in a conversation |
sessionEndedMessage | This conversation has ended. | Message that appears when the chat session has ended |
splitTextLessButtonLabel | Show more | The label of the button to show more text when splitText is enabled |
splitTextMoreButtonLabel | Show less | The label of the button to hide the more text when splitText is enabled |
system | System | Name of the system user (for system messages) |
systemPostConversationCloseButtonLabel | Minimize Widget | Label of the button to minimize the widget when the conversation has ended |
systemPostConversationStartButtonLabel | Start New Conversation | Label of the button to start a new conversation when the conversation has ended |
systemPostConversationMessage | Do you want to start a new conversation? | Message shown when the conversation has has ended |
WCFS has introduced default values for the following existing icons:
avatarAgent
avatarBot
avatarUser
To clear them just set them as empty strings:
icons: {
avatarAgent: '',
avatarBot: '',
avatarUser: ''
}
Notes:
avatarAgent
icon the avatarBot
key needs an icon, either the default one or a custom one.avatarAgent
has no custom icon set then:avatarAgent
icon is shown. For more details see Bot and Agent Name Customization.The following custom icons are specific to WCFS and come with default values:
infoMessage
icon shown when the system user posts an information messagewarningMessage
icon shown when the system user posts a warning messageerrorMessage
icon shown when the system user posts an error messagedownloadMessage
icon shown when the system user is downloading an attachmentsensitiveInformationMessage
icon shown when the system user posts the sensitiveInformationMessage
messageoffTheRecordOffMessage
icon shown when the system user posts the offTheRecordOffMessage
messageoffTheRecordOnMessage
icon shown when the system user posts the offTheRecordOnMessage
messageoffTheRecordOff
menu icon that indicates that off the record is disabledoffTheRecordOn
menu icon that indicates that off the record is enabledFor more information on how to customize icons go to the ODA Native Client SDK for Web documentation.
The following methods
are specific to WCFS:
Name | Description |
---|---|
isBot | Returns true when the established connection is with a bot |
printConversation | Prints the conversation |
resetPreLaunchForm | Resets the pre-launch form |
updateConditionalLaunchButtonDetails | Updates the conditional launch button details |
updateConnectionData | Updates the connection data |
updatePosition | Updates the widget position |
The following web-sdk methods are not supported by WCFS:
cancelTTS
getAgentDetails
getSuggestions
getTTSVoice
getTTSVoices
getUnreadMessagesCount
sendAttachment
sendMessage
sendUserTypingStatus
setAgentDetails
setAllMessagesAsRead
setPrimaryChatLanguage
setSkillVoices
setSpeechLocale
setTTSService
setTTSVoice
setUserAvatar
speakTTS
startVoiceRecording
stopVoiceRecording
updateUser
The widget can be opened passing default connection data before starting the conversation without any user interaction. For example for a logged in user pass the email address.
Supported connectionData
keys with their mappings:
WCFS attribute | B2C API attribute | FUSION API attribute | Required service version |
---|---|---|---|
applicationClassification | applicationClassification | 11.13.23.04.0 | |
assigneeId | assigneeId | 11.13.23.07.0 | |
businessUnitOrgId | businessUnitOrgId | 11.13.19.01.0 | |
categoryId | cat | categoryId | |
chatPriority | chatPriority | 11.13.19.07.0 | |
contactId | contactId | ||
emailAddress | |||
firstName | firstName | firstName | |
incidentSeverityCode | incidentSeverityCode | 11.13.23.04.0 | |
incidentType | incidentType | ||
inventoryItemId | inventoryItemId | ||
inventoryOrgId | inventoryOrgId | ||
lastName | lastName | lastName | |
organizationId | organizationId | ||
productGroupId | prodGroupId | ||
productId | prod | productId | |
queueId | queueID | queueId | |
serviceRequestNumber | incidentName | ||
stripeCode | stripeCode | 11.13.23.04.0 | |
subject | subject | question |
Notes:
serviceRequestNumber
is provided with no incidentType it will default to SVC_SERVICE_REQUESTS
.incidentSeverityCode
requires serviceRequestNumber
to be set as well in order to work.connectionData
is only required if you want to set default values.subject
240 characters.firstName
and lastName
80 characters.Example with all custom field type use cases:
connectionData: {
lastName: 'Anonymous',
queueId: '25',
productId: '2',
customFields: [
{ name: 'my_text_customfield', value:'Single line' },
{ name: 'my_textarea_customfield', value: 'Line1\nLine2' },
{ name: 'my_integer_customfield', value: 99 }, // '99' is also valid
{ name: 'my_yesno_customfield', value: '0' }, // '0' = No, '1' = Yes
{ name: 'my_menu_customfield', value: '2' }, // The index of the menu item (1 is the first item)
{ name: 'my_date_customfield', value: '2022-10-24' },
{ name: 'my_datetime_customfield', value: '2020-08-01T20:40:00+05:30' }
]
}
You can update the data with the updateConnectionData
method. When it is executed while a connection has already be established it will only take effect on the next connection.
Example:
Bots.updateConnectionData({
email: 'new.email@test.com',
customFields: [{ name: 'my_text_customfield', value: 'Hello World!' }]
});
All the connection data attributes can also be entered via a pre-launch form which will pre-fill the fields with their eventual default value set in connectionData
.
By default the pre-launch form is secured to prevent users to modify it in the browser, this will avoid them to be able to start a chat session by by-passing its validations.
You can disable this security check with the following setting key:
enablePlfSecurity: false // (default is true)
Configure the preLaunchFormFields
setting to customize the fields to show in the pre-launch form. The name
key is the only required one.
name
One of the supported connectionData
keys (see table above) or your custom field name.required
Mark the fields as mandatory: false (default) | true.relaunchValue
What has to happen to the field value for the next conversation.clear
This will set the value to ''.default
This will reset the field to its default value, when empty it does the same as clear.keep
This will pass the value from the previous conversation.options
An array of value and text keys that when present will render an input drop-down list instead of an input field.customFieldType
When the field is a custom field specify its type: text (default) | integer | textArea | date | dateTime | yesNo | menu(*).pattern
Optional regular expression for fields of type 'text'.(*) customFieldType
"menu" requires options for the drop-down list values.
Example with all custom field type use cases:
preLaunchFormFields: [
{name: 'subject', required: false, relaunchValue: 'clear'},
{name: 'firstName', required: true, relaunchValue: 'keep'},
{name: 'lastName', required: true, relaunchValue: 'keep'},
{name: 'email', required: true, relaunchValue: 'keep'},
{name: 'productId', required: true, relaunchValue: 'default',
options: [
{value: '1', text: 'Product group 1',
children: [
{value: '11', text: 'Product name 1-1'},
{value: '12', text: 'Product name 1-2'}
]
},
{value: '2', text: 'Product group 2',
children: [
{value: '21', text: 'Product name 2-1'},
{value: '22', text: 'Product name 2-2'}
]
}
]
},
{name: 'my_text_customfield', required: false, relaunchValue: 'keep', customFieldType: 'text'},
{name: 'my_textarea_customfield', required: false, relaunchValue: 'keep', customFieldType: 'textArea'},
{name: 'my_integer_customfield', required: false, relaunchValue: 'keep', customFieldType: 'integer'},
{name: 'my_yesno_customfield', required: false, relaunchValue: 'keep', customFieldType: 'yesNo'},
{name: 'my_menu_customfield', required: false, relaunchValue: 'keep', customFieldType: 'menu'
options: [ // menu requires options
{value: '1', text: 'Menu item 1'},
{value: '2', text: 'Menu item 2'},
{value: '3', text: 'Menu item 3'}
]
},
{name: 'my_date_customfield', required: false, relaunchValue: 'keep', customFieldType: 'date'},
{name: 'my_datetime_customfield', required: false, relaunchValue: 'keep', customFieldType: 'dateTime'}
]
For the standard field labels see the custom text
keys starting with plf
in the Settings section for the default values.
For custom field labels add a key in i18n that concatenates the field name with the word Label
. As an example for the custom fields above:
i18n: {
en: {
my_text_customfieldLabel: 'Text Field',
my_textarea_customfieldLabel: 'Text Area',
my_integer_customfieldLabel: 'Integer',
my_yesno_customfieldLabel: 'Yes / No',
my_menu_customfieldLabel: 'Menu',
my_date_customfieldLabel: 'Date',
my_datetime_customfieldLabel: 'Date Time'
}
}
You can set the pattern
attribute for the standard fields and the custom fields of type text
with a regular expression to determine if the value of the field is valid. If the field is not valid you can also add a custom message to i18n by adding a key that is the concatenation of the field name and the word Message
. Here is an example for a standard field and a custom field.
preLaunchFormFields: [
{
name: 'firstName',
required: true,
pattern: '[a-zA-Z]{1,15}'
},
{
name: 'birthDate',
required: true,
customFieldType: 'text',
pattern: '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])'
}
],
i18n: {
en: {
firstNameMessage: 'No numbers and max 15 characters',
birthDateLabel: 'Birth Date',
birthDateMessage: 'Date format: YYYY-MM-DD'
}
}
When no entry has been added to i18n then the default browser message Please match the required format
will be shown.
You can make the visibility of the fields dynamic by adding dependencies. You can either hide or show a field when another one matches a value or a regular expression.
Add a dependency
attribute to the field with the following attributes:
fieldName
The name of the field this field depends on.action
Either show
or hide
this field.values
An array of values or regular expressions. When the dependent field matches one of these, the action on this field is triggered.enableRegExp
When set to true
the expected values
are regular expressions, the default is false
.When a field is hidden it will restore the value based on its relaunchValue
, see Fields for more details.
Here are some examples that demonstrate how it works:
preLaunchFormFields: [
{
name: 'country',
required: true,
customFieldType: 'menu',
options: [ { value: 'US', text: 'United States' }, { value: 'UK', text: 'United Kingdom'}, { value: 'AU', text: 'Australia'}, { value: 'Other', text: 'Other Country' } ]
},
{
name: 'language',
required: true,
customFieldType: 'menu',
options: [ { value: 'ES', text: 'Spanish' }, { value: 'IT', text: 'Italian' }, { value: 'FR', text: 'French' }, { value: 'DE', text: 'German' } ],
dependency: {
fieldName: 'country',
action: 'show',
values: ['Other']
}
},
{
name: 'latin',
required: true,
customFieldType: 'yesNo',
dependency: {
fieldName: 'language',
action: 'show',
values: ['ES']
}
}
],
i18n: {
en: {
countryLabel: 'Country',
languageLabel: 'Language',
latinLabel: 'Latin'
}
}
show
action, the same can be achieved by using the hide
action on the language field by changing the dependency
attribute as follows:dependency: {
fieldName: 'country',
action: 'hide',
values: ['US', 'UK', 'AU', '']
}
123
or 321
.preLaunchFormFields: [
{
name: 'trackingId',
required: true,
customFieldType: 'text',
pattern: '[0-9]{10}',
},
{
name: 'zipCode',
required: true,
customFieldType: 'text',
dependency: {
fieldName: 'trackingId',
action: 'show',
values: ['^123[0-9]{7}', '^321[0-9]{7}'],
enableRegExp: true
}
}
],
i18n: {
en: {
trackingIdLabel: 'Tracking ID',
zipCodeLabel: 'ZIP Code',
trackingIdMessage: 'Enter a 10 digit tracking ID'
}
}
You can add a header and / or a footer using the following custom text
keys:
plfHeaderHtml
plfFooterHtml
By default they are blank so no header and / or footer are added to the pre-launch form field unless they are defined.
Example:
i18n: {
en: {
plfHeaderHtml: '<span style="font-size: x-large; font-weight:bold;">Live Chat</span>',
plfFooterHtml: 'By clicking on Start Chat, you are agreeing to our <a href="https://www.oracle.com/legal/terms.html" target="_blank"> terms of service</a>.'
}
}
You can reset the fields with the resetPreLaunchForm
method. This will clear the previous one and update it with the new fields.
As an example, if you would have initiated the widget with 3 fields, firstName, lastName and email and you would want to add a subject field you would have to do:
Bots.resetPreLaunchForm([
{ name: 'subject', required: false, relaunchValue: 'keep' },
{ name: 'firstName', required: true, relaunchValue: 'default' },
{ name: 'lastName', required: true, relaunchValue: 'default' },
{ name: 'email', required: true, relaunchValue: 'default' }
]);
// Optionally set a default value
Bots.updateConnectionData({
subject: 'help'
});
Use the following values to customize the showPreLaunchForm
setting:
always
This is the default, every time a new conversation is started the form will be shown before connecting and starting the conversation.initial
The form will only open once, when connecting for the first time. The pre-launch form allows the user to interact before starting the conversation and provide supported profile information like a an email, a product, etc…never
Connect and start the conversation without any user interaction.The pre-launch form is using the WEB SDK popup and form and thus uses these associated existing CSS variables:
CSS variable | Settings variable | Description |
---|---|---|
--color-popup-background |
popupBackground | The background color of prompts and popups |
--color-popup-text |
popupText | The text and icon color of prompts and popups |
--color-popup-button-background |
popupButtonBackground | The background color of popup buttons |
--color-popup-button-text |
popupButtonText | The text color of popup buttons |
--color-popup-item-background-hover |
popupItemBackgroundHover | The background color on hover of popup list items |
--color-form-input-text |
formInputText | The input text field color |
--color-form-actions-background |
formActionsBackground | The input text field background color |
--color-form-input-border |
formInputBorder | The input text field border color |
--color-form-error |
formError | The input text field border color when validation errors occur |
When a connection is established and persistence
is enabled then data is stored in session storage that will be reused to re-establish the connection to Chat after navigating away or reloading the page.
When using multiple bots on the same page make sure they have different names, for more details see Multiple Bots.
When you need to know before instantiating the widget if it will be starting a new connection or if it will be restoring a previous one, you can use the isNewSession
method providing the bot name, it will return true
or false
.
Example without a bot name:
let newSession = WCFSSDK.isNewSession(); // defaults to 'wcfs'
Example with a bot name:
let newSession = WCFSSDK.isNewSession('my-chatbot');
When the chat is not persistent and the page is closed, left or reloaded then the connection will be closed. You can decide which of the following events handles it:
unload
beforeunload
(default, not compatible with showPageLeaveWarning
)pagehide
Example:
disconnectEvent: 'pagehide'
To manage file and location sharing use these 4 settings:
enableAttachment
to show the share file menu item when clicking the share buttonattachmentSettings
set file upload and download settings depending on your serviceattachmentMode
when to show the share file menu itemagent
default value, shows the share file menu item when connected to an agentagentAndBot
shows the share file menu item when connected either to an agent or a bot (*)agentAndBotSkill
shows the share file menu item when connected either to an agent or a bot with the difference that the skill is controlling when the menu item is shown (*)enableLocation
to show the share location menu item when clicking the share buttonNotes:
shareMenuItems
to build the share button menu list values.${system.message.payload}
variable. Consuming the file will require a custom implementation depending on the service.You can also decide if the agent can send files to WCFS, this is enabled by default:
enableAgentAttachment
The maximum file size is not customizable in WCFS. The default value for Oracle hosted mailboxes is 20 MB with a maximum of 120 MB. For more information see Answer Id 208.
When WCFS is used anonymously the maximum file size will depend on the browser's resources to process large blobs as the file is uploaded as a converted base64 string. While as when the user is authenticated the limit will depend on the cloud resources WCFS is connected to such as disk storage, memory, etc.
The default WCFS maximum upload size is set 200 MB, to customize it use attachmentSettings
setting key.
Example, set the maximum size to 1 GB:
attachmentSettings: {
maxFileSizeMb : 1024
}
To avoid server side validation when uploading invalid file types, make sure that WCFS is configured with those that the server will accept. You can also configure WCFS with a subset of them.
The B2C default files types for WCFS 24B and higher are:
If you are on CX version 23A+ or higher and if you have changed the default file types you will have to do the same in WCFS using the attachmentSettings
setting key. For more information see Answer ID 12603.
Example:
attachmentSettings: {
supportedFileTypes: 'jpg png gif mp3 mp4' // Modified VALID_FILE_EXTENSIONS or subset
}
Prior CX version 23A+ the file types are static and you will have to configure WCFS to use the old default ones for the client validation to be in sync with the server:
attachmentSettings: {
supportedFileTypes: 'bmp doc docx gif jpeg jpg pdf png txt xls xlsx'
}
By default the Fusion service is not setting any default file types, the following file types are black listed on the client side:
To set the list of supported file types use the attachmentSettings
setting key:
attachmentSettings: {
supportedFileTypes: 'bmp gif jpeg jpg png' // Only pictures
}
When WCFS is notified that the agent has shared a file it will retrieve the download link. By default WCFS will fetch the file into a blob and use its address for the anchor tag. Clicking the download link is only copying the file from memory to disk so it will be available after the session is closed.
For the B2C service there is no choice as the download link requires extra headers and can't be consumed without a fetch.
For the Fusion service the link can also be used as a get, meaning that WCFS can offer the alternative to directly put the download link into the anchor and only download the file when the user clicks on it. The drawback is that when the session is closed the download link can't be consumed anymore. To change WCFS to this behavior add this setting to the attachmentSettings
setting:
attachmentSettings: {
standardDownload: false // (default is true)
}
When attachmentMode
is set to agentAndBotSkill
and WCFS is connected to a bot then the file menu item will be shown and removed when the skill sends a request to do so using the ODA osvc
channel extension.
Set the channel custom property enableFileSharing
to one of these values:
true
show the share file menu itemfalse
remove the share file menu itemonce
show the share file menu item and remove it just after receiving the responseSimple examples that illustrate how enableFileSharing
works:
true
/ false
use case that gives control to show and remove the share file menu item at will. # show the share file menu item
show_share:
component: "System.CommonResponse"
properties:
processUserMessage: false
keepTurn: false
metadata:
responseItems:
- type: "text"
text: "Upload is now enabled."
channelCustomProperties:
- channel: "osvc"
properties:
enableFileSharing: "true"
transitions:
return: "done"
# remove the share file menu item
remove_share:
component: "System.CommonResponse"
properties:
processUserMessage: false
keepTurn: false
metadata:
responseItems:
- type: "text"
text: "Upload is now disabled."
channelCustomProperties:
- channel: "osvc"
properties:
enableFileSharing: "false"
transitions:
return: "done"
once
use case that shows the share file menu item and removes it after receiving the response. # Request the user to upload a file
share_once:
component: "System.CommonResponse"
properties:
processUserMessage: true
keepTurn: false
metadata:
responseItems:
- type: "text"
text: "Upload your file now !!!"
channelCustomProperties:
- channel: "osvc"
properties:
enableFileSharing: "once"
transitions:
next: "uploaded"
# Notify the user the file has been received
uploaded:
component: "System.Output"
properties:
text: "Thanks, got your file ${system.message.payload.userFName} !!!"
transitions:
return: "done"
There are circumstances when the user is not ending the conversation:
When one of the above events happens a system message with the reason is shown followed by another customizable one with one or two customizable buttons (depending if embedded mode is enabled):
systemPostConversationMessage
showSystemMessageMinimizeButton
(default true)systemPostConversationStartButtonLabel
showSystemMessageMinimizeButton
(default true)systemPostConversationCloseButtonLabel
When both buttons are disabled and the value of the message custom text
key is empty then nothing is shown, in other words it is disabling the system message.
When the user ends the conversation you might want to interrupt closing the widget to show a special message, most probably to offer a survey. Same for the agent, you might want to show something else than the default system message.
When you enable enablePostConversationMessage
then the post conversation message is shown when either the agent or the user ends the conversation.
Because the most common usage of this feature will be for surveys the default values of the custom text
keys postConversationMessage
and postConversationMessageLinkButtonLabel
are set for this purpose as an example.
Below this post conversation message the same buttons as the system message to minimize the widget and to start a new conversation are shown depending on theirs settings (showSystemMessageMinimizeButton
and showSystemMessageMinimizeButton
), see System Message.
There is also an optional button that can be added which allows to print the conversation, see Conversation Printing.
There are 3 types of post conversation messages:
message
When the conversation is ended the message associated to the text key postConversationMessage
is shown.
Example:
enablePostConversationMessage: true,
postConversationMessageOptions: {
type: 'message'
}
link
Same as message
with a button with the text from postConversationMessageLinkButtonLabel
, it will open the custom URL.
Example:
enablePostConversationMessage: true,
postConversationMessageOptions: {
type: 'link',
url: 'http://mysurvey.com/'
}
iframe
Same as message
but render an iframe with a custom URL. The iframeLocation
setting allows to position it either in the message bubble or below the conversation.
Example:
enablePostConversationMessage: true,
postConversationMessageOptions: {
type: 'iframe',
iframeLocation: 'below', // bubble (default) | below
url: 'http://mysurvey.com/',
iframeStyles: [
{name: 'min-height', value: '300px'}, // use min-height iso height
{name: 'borderWidth', value: '0px'}
],
enablePrintButton: true // Also show the print conversation button
}
B2C surveys links need the engagement ID in it, see Answer ID 11787 for more details.
You can use the URL Customization feature to achieve it, as an example:
postConversationMessageOptions: {
type: 'link', // or iframe
url: 'http://acme.custhelp.com/ci/documents/detail/5/11/6/223/7/{ENGAGEMENT_ID}/12/245cfe1718889dd43ee26d6654e354af8331c668)',
urlParameters: [
{fieldName: 'engagementId', substitutionString: '{ENGAGEMENT_ID}'}
]
}
You can customize the URL with substitution strings to add parameters that can be replaced by field values.
The following keys are supported:
engagementId
agentId
- Fusion service only (*)timestamp
(*) When the user has been transferred to different agents, agentID will then contain the last agent of the conversation.
For example:
enablePostConversationMessage: true,
postConversationMessageOptions: {
type: 'link',
url: 'http://myhost.com?pid={pid}&cf={cf}&aid={aid}&eid={eid}&ts={ts}',
urlParameters: [
{fieldName: 'productId', substitutionString: '{pid}'},
{fieldName: 'customField', substitutionString: '{cf}'},
{fieldName: 'agentId', substitutionString: '{aid}'},
{fieldName: 'engagementId', substitutionString: '{eid}'},
{fieldName: 'timestamp', substitutionString: '{ts}'}]
},
connectionData: {
productId: '55555',
customFields: [
{ name: 'customField', value: 'custom value' }
]
},
Would produce this URL:
http://myhost.com?pid=55555&cf=custom%20value&aid=300100098008382&eid=36996&ts=2024-09-18T08%3A29%3A24.295Z
To enable the print button, you need to enable enablePostConversationMessage
(See Post Conversation Message) and add to postConversationMessageOptions
the enablePrintButton
setting Key. The custom text
key of the button is postConversationPrintButtonLabel
.
Example:
enablePostConversationMessage: true,
postConversationMessageOptions: {
type: 'message',
enablePrintButton: true // (default false)
}
The method invoked by enablePrintButton
to print the conversation can also be used by calling printConversation
.
Example:
Bots.printConversation();
Styles have been added as a @media print rule to improve the readability of the printed version of the conversation.
These are the default styles that can be tweaked and passed as a string using the printStyles
setting key.
svg * {
display: none;
}
input {
border: 0px;
}
textarea {
border: 0px;
}
select {
border: 0px;
}
.wcfs-split-text {
display: unset!important;
}
.wcfs-split-button {
display: none!important;
}
.CSS_PREFIX-icon-wrapper {
display: none;
}
.CSS_PREFIX-message-block {
padding-top: 12px;
}
.CSS_PREFIX-screen-reader-only {
font-weight: bold;
}
.CSS_PREFIX-timestamp-header {
font-weight: bold;
padding-top: 12px;
text-align: center;
}
.CSS_PREFIX-relative-timestamp {
font-weight: bold;
padding-top: 12px;
text-align: center;
}
.CSS_PREFIX-icon {
display: none!important;
}
.CSS_PREFIX-hr {
font-weight: bold;
padding-top: 12px;
text-align: center;
}
.CSS_PREFIX-flex {
display: block;
}
.CSS_PREFIX-none {
display: block;
}
.CSS_PREFIX-listbox {
display: none;
}
.CSS_PREFIX-button-cell {
display: none;
}
.CSS_PREFIX-next {
display: none;
}
.CSS_PREFIX-previous {
display: none;
}
.CSS_PREFIX-attachment-controls {
display: none;
}
.CSS_PREFIX-table-message-heading {
font-weight: bold;
}
.CSS_PREFIX-form-message-key {
font-weight: bold;
display: initial;
margin-right: 8px;
vertical-align: top;
}
[dir="rtl"] .CSS_PREFIX-form-message-key {
margin-left: 8px;
}
.CSS_PREFIX-form-message-value {
display: initial;
}
.CSS_PREFIX-message {
margin-top: 6px;
}
The string CSS_PREFIX
will be replaced with the value of the name
setting which is used as CSS prefix.
The locale
setting will only determine the WCFS UI language. The language for the live agent and the skill locale variable (profile.locale) are set by the interface (vhost).
Example:
URI: 'site-es-es.widget.host.com',
locale: 'es-ES'
Starting WCFS 23.04 & Fusion 23C the locale
setting will set the WCFS UI, the live agent language and the skill locale variable (profile.locale).
Example:
locale: 'es-ES'
For a skill that supports more than one language with resource bundles you need to set the languageTag
. If not it will default to its Primary Language
.
Example:
setLanguage:
component: "System.SetVariable"
properties:
variable: "profile.languageTag"
value: "${profile.locale}"
transitions:
next: "..."
WCFS does not support dynamicaly changing the language during the conversation, so the Oracle Digital Assistant Native Client SDK for Web setting multiLangChat
is NOT supported.
When conditionalLaunchButton
is enabled and combined with conditionalLaunchButtonDetails
a call is done to Chat when the widget is loaded to retrieve availability information that will determine if the launch button is shown or not.
The setting conditionalLaunchButton
can have 4 values:
off
: The launch button is always shown.officeHours
: The launch button is not shown out of office hours or during holidays (only for B2C service).liveAgent
: The launch button is shown when there is at least one available agent session.custom
: Customise your own condition combining any of agent session availability, queue size and queue wait time.You can fine tune the call by setting these parameters:
queueId
a comma separated string of queue IDs (cannot be combined with productId
or categoryId
)productId
a product ID (only for service B2C and cannot be combined with queueId
)categoryId
a category ID (cannot be combined with queueId
)Example:
conditionalLaunchButton: 'liveAgent',
conditionalLaunchButtonDetails: {
queueId: '23, 56'
}
You can fine tune the availability condition with the following parameters by setting conditionalLaunchButtonDetails
to custom
and set one or more of these parameters:
minAgentSessions
: Minimum number of available agent sessions.maxQueueSize
: Maximum number of end users that can be added to a queue.maxWaitSeconds
: Maximum wait time in queue in seconds.For example, if you would want to show the button only when the wait time is less than a minute and there are less than 5 end users in the queue:
conditionalLaunchButton: 'custom',
conditionalLaunchButtonDetails: {
maxQueueSize: '5',
maxWaitSeconds: '60'
}
Notes:
minAgentSessions
with maxQueueSize
or maxWaitSeconds
does not make much sense.conditionalLaunchButton
to liveAgent
is just a shortcut, these 2 are the same:conditionalLaunchButton: 'liveAgent',
conditionalLaunchButtonDetails: {
categoryId: '23'
}
conditionalLaunchButton: 'custom',
conditionalLaunchButtonDetails: {
minAgentSessions: '1'
categoryId: '23'
}
When enabled, WCFS will continue evaluating the condition that determines if to show the launch button or not. WCFS will then poll every 12 seconds for the first 5 minutes. Thereafter, WCFS will poll once a minute for the next 55 minutes and will stop after 1 hour.
Example:
conditionalLaunchButtonDetails: {
enablePolling: true
}
You can update the condition details with the updateConditionalLaunchButtonDetails
method any time.
Example:
Bots.updateConditionalLaunchButtonDetails({
enablePolling: true,
queueId: '98'
});
Note that it also allows you to stop and start the polling.
conditionalLaunchButton: 'liveAgent',
conditionalLaunchButtonDetails: {
categoryId: '45'
}
conditionalLaunchButton: 'custom',
conditionalLaunchButtonDetails: {
enablePolling: true,
queueId: '33',
maxWaitSeconds: '300'
}
Proactive Chat is an extension of the Conditional Launch Button feature, instead of showing the launch button it will display a dialog with a chat invitation.
First configure the agent availability condition and polling settings as described in the Conditional Launch Button section above.
Use the enableProactiveChat
setting key to enable proactive chat:
conditionalLaunchButton: 'liveAgent',
enableProactiveChat: true
It is not mandatory to set conditions. If you only enable proactive chat then the dialog will be immediately shown when loading the widget.
This is a schema of the dialog with the custom text
keys, and the class and style attributes:
<dialog class="dialogClasses" style="dialogStyles">
<div class="dialogTitleClasses" style="dialogTitleStyles">pacDialogTitleHtml</div>
<div class="dialogTextClasses" style="dialogTextStyles">pacDialogTextHtml</div>
<div class="dialogButtonsClasses" style="dialogButtonsStyles">
<button class="dialogNoButtonClasses" style="dialogNoButtonStyles">pacNoButtonLabel</button>
<button class="dialogYesButtonClasses" style="dialogYesButtonStyles">pacYesButtonLabel</button>
</div>
</dialog>
The dialog can be customized with the following custom text
keys as shown in the above dialog schema:
pacDialogTitleHtml
pacDialogTextHtml
pacNoButtonLabel
pacYesButtonLabel
You can apply classes and / or styles to the dialog with the proactiveChatDialogCss
setting key using the following attributes as shown in the above dialog schema:
dialogClasses
dialogStyles
dialogTitleClasses
dialogTitleStyles
dialogTextClasses
dialogTextStyles
dialogButtonsClasses
dialogButtonsStyles
dialogNoButtonClasses
dialogNoButtonStyles
dialogYesButtonClasses
dialogYesButtonStyles
A string containing one ore multiples classes can be passed to the classes attributes:
proactiveChatDialogCss: {
dialogClasses: 'dialog-class base-class'
}
An array of name–value pairs can be passed to the styles attribute:
proactiveChatDialogCss: {
dialogStyles: [
{name: 'padding', value: '0px'},
{name: 'border-color', value: 'darkgray'}
]
}
As an alternative instead of opening the hidden chat widget, you can launch a page based upon the URL defined in the proactiveChatUrl
setting key.
proactiveChatUrl: {
url: 'https://myURL',
windowFeaturesParameter: [ // An array of name–value pairs for the window.open features parameter
{name: 'height', value: '620'},
{name: 'width', value: '380'}
]
}
Conditional Chat Link is also an extension of the Conditional Launch Button feature, instead of showing the launch button it will show a link in your web page.
First configure the agent availability condition and polling settings as described in the Conditional Launch Button section above.
Use the enableConditionalChatLink
and conditionalChatLinkElementId
setting keys and update your web page to configure the conditional chat link:
conditionalLaunchButton: 'liveAgent',
enableConditionalChatLink: true,
conditionalChatLinkElementId: 'wcfs-ccl'
<h5>Contact Us</h5>
<ul>
<li><a>US Sales: +1.800.633.0738</a></li>
<li><a>Global Contacts</a></li>
<li><a>Subscribe to emails</a></li>
<li id="wcfs-ccl"></li>
</ul>
The link text and aria label can be changed using the following custom text
keys:
cclLinkAriaLabel
cclLinkText
You can apply classes and / or styles to the link with the conditionalChatLinkCss
setting key:
conditionalChatLinkCss: {
styles: [
{name: 'color', value: 'red'},
{name: 'background-color', value: 'black'},
],
classes: 'ccl-class'
},
By default the launch button will only show an icon, see Custom Icons for more details. You can add some text either to its right or left by enabling the setting enableText
, the translation string key is launchButtonText
.
Example:
launchButtonSettings: {
enableText: true, // default is false
textPosition: 'start' // end (default) | start
}
You can style the button by providing a valid array of style key pairs.
Example:
launchButtonSettings: {
styles: [
{name: 'color', value: 'white'},
{name: 'height', value: '75px'},
{name: 'width', value: '200px'},
{name: 'font-size', value: 'large'},
{name: 'border-radius', value: '25px'}
]
}
When the full answer intent is too long you can configure WCFS to only show part of the message with a button that will toggle the visibility of the rest of the message. Set splitText
to one of these values with a tag
or position
in splitTextSettings
:
tag
: The text will split using a tag that is added to the skill text and defined in splitTextSettings
, for example:splitText:
component: "System.Output"
properties:
text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.{split} Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
transitions:
return: "done"
splitText: 'tag',
splitTextSettings: {
tag: '{split}'
}
hardPosition
: The text will split at the position defined in splitTextSettings
, for example:splitText: 'hardPosition',
splitTextSettings: {
position: 100
}
softPosition
: For languages that use a space as delimiter between words, avoid word truncation by splitting the text at the first space before the position defined in splitTextSettings
, for example:splitText: 'softPosition',
splitTextSettings: {
position: 100
}
off
: No text splitting (default)splitTextSettings
has no default values, so if splitText
is enabled without any settings no text splitting will occur.tag
option supports HTML text splitting, but make sure you have correct HTML before and after the tag. softPosition
& hardPosition
options will not split the text when HTML is detected.splitTextSettings
but splitText
is not set to tag
, then the tag will still be removed. This will allow having tags in the text and be able to disable splitText
or use it with hardPosition
or softPosition
. For example:splitText: 'softPosition',
splitTextSettings: {
tag: '{split}',
position: 100
}
You can customize the name of the bot and the name of the agent in the conversation. Use the following setting keys:
botNameMode
agentNameMode
Set them to one of these values:
noName
The name is not shown (default value for botNameMode
)fullName
The name received from the chat server is shown (default value for agentNameMode
)firstName
First 'word' of the name received from the chat server is shownlastName
Last 'word' of the name received from the chat server is showndefaultName
The value from a custom text
key is shown:bot
agent
(See ODA Native Client SDK for Web for more details)These settings will also affect the substitution strings of the Bot and Agent Client Greeting.
For example to use the client custom text
key for the bot and the first name for the agent:
botNameMode: 'defaultName',
agentNameMode: 'firstName'
By default the greeting displayed by WCFS when connecting is the one received from Chat. You can overwrite it with a client one defined as a custom text
key.
Bot
enableClientGreetingBot
clientGreetingBot
Agent
enableClientGreetingAgent
clientGreetingAgent
Notes:
custom text
key is set to an empty string then no greeting is show.custom text
key is the one set by its corresponding Bot and Agent Name Customization.Page Peek
and Visitor Browser History
are available when using Engagement Engine to invoke WCFS and no settings are required for these features.
When invoking WCFS using Engagement Engine with Proactive Chat or Conditional Chat Link enabled, the Visitor Service events offer
and accept
are recorded in the visitor_sessions
and roi_conversion_offer_stats
tables. No settings are required for this feature.
For Fusion we allow you to add a JWT to the settings that will be used to start a chat for an authenticated user:
authorization: {
type: "bearer",
token: "insert JWT here"
}
The JWT can be retrieved from the Fusion token relay service.
You can setup more than one bot on the same page but they need to have different names. The default value of the name
setting key is wcfs
. To change it:
name: 'my-second-bot'
As a reminder the description of the name
setting key form the ODA Native Client SDK for Web Documentation.
The name for the instance. Provides a namespace to the instance and is used as prefix for the CSS class names and element IDs.
WCFS uses it to manage persistent conversations.
You can give the user the ability to send off the record messages to the agent by adding a button in the header to toggle it on or off. To enable the feature set the enableOffTheRecord
to true:
enableOffTheRecord: true
Note that off the record messages is not designed to work with ODA skills, ODA will still store the messages.
You can enable WCFS to examine the messages for sensitive information such as credit card and social security number patterns.
When sensitive information is detected the message can be:
There are patterns built-in into WCFS but you can also use your own regular expressions. The built-in pattern setting values are:
creditCard
socialSecurity
To enable sensitive information detection to send the messages off the record set the offTheRecordPatterns
setting key. For example enable it for both credit card, social security numbers and your own pattern:
offTheRecordPatterns: [ 'creditCard', 'socialSecurity', '[0-9]{4}[a-z]{2}' ]
Note that the message is not only sent off the record, the message is also not stored in the browser's storage which is mainly used for persistent chats.
To enable sensitive information detection to send the detected values masked set the maskingPatterns
setting key.
You can also customize the masking using the following setting
keys:
maskingCharacter
The character masking the sensitive information string, the default is '#'maskingMode
full
Fully replace the matched pattern (default)partial
Partially replace the matched pattern showing only the last 4 charactersFor example enable it to match both credit card patterns and your own pattern and overwrite the default options:
maskingPatterns: [ 'creditCard', '[0-9]{4}[a-z]{2}' ],
maskingCharacter: '*', // default is '#'
maskingMode: 'partial', // default is 'full'
subject
Connection DataWhen maskingPatterns
is set then any sensitive information detected in the subject will also be masked.
Mind when offTheRecordPatterns
is set, the subject cannot be sent off the record when it contains sensitive information. To avoid the sensitive information to be recorded, it will be sent masked.
Enabling the enableEndConversation
setting key adds a close button which is only effective when there is an active session, see the ODA Native Client SDK for Web for more details.
WCFS has added a new setting key enableEndConversationButtonToClose
to extend the functionality of this button to allow it to close the widget when:
Example:
enableEndConversationButtonToClose: true
For the button the label a new custom text
key endConversationAndClose
has also been added to reflect that it is not only to end the conversation but to close the widget.
Note that this setting is not supported in embedded mode.
By default when the widget is closed the converation is also cleared, meaning that when the widget is opened again the new conversation will start with an empty transcript. You can change this behavior by using the clearConversationOnClose
setting key:
clearConversationOnClose: false
Note that in embedded mode this will also work but when the conversation is ended.
Content Security Policy (CSP) is an added layer of security that helps detecting and mitigating certain types of attack, including Cross-Site Scripting (XSS) and data injection attacks. WCFS supports the use of CSP.
If your CSP has a restrictive style-src, style-src-attr or style-src-elem then WCFS styling will not work out of the box. To get WCFS working you need to disableInlineCSS
:
disableInlineCSS: true
This will prevent WCFS from doing any disallowed styling. To get styling back, you will need to add the CSS file to your webpage yourself:
<link rel="stylesheet" href="./styles/styles.css">
Notes:
logo
that contains inline CSS. You should replace or remove this logo.If your CSP has a restrictive script-src, script-src-attr or script-src-elem then our example will not work as-is. The wcfs-sdk.js is loaded with a script tag that has an onload
. We recommend removing the onload and add the initSdk
to the settings.js:
initSdk('Bots');
If you have a restrictive connect-src you need to make sure the chat widget can connect to the configured URL, as well to the chat server. Make sure you wildcard the chat server correctly so that your chat continues working after upgrades.
Take care you review other restrictions as well. For example if users can receive images over chat then the img-src might need to be updated, or if users can receive videos or pdf files then object-src or frame-src might need to be updated.
Previously to enable the location sharing the setting enableAttachment
had to be enabled. In WCFS 23.04
this will enable file sharing so the new parameter enableLocation
should be used instead.
The way custom fields are specified and how default values are set have changed in 23.04
. This example shows how to change the connectionData
:
23.02
connectionData: {
firstName: 'anonymous',
lastName: 'anonymous',
email: 'anonymous@test.com',
custom_field_test: 'test',
custom_field_dummy: 'dummy'
}
23.04
connectionData: {
firstName: 'anonymous',
lastName: 'anonymous',
email: 'anonymous@test.com',
customFields: [
{ name: 'custom_field_test', value: 'test'},
{ name: 'custom_field_dummy', value: 'dummy'}
]
}
The serviceVersion
setting used for Fusion is not required anymore and has been removed.
The custom text
key sessionReconnectButtonLabel
has been removed.
The end session messages had a button to start a new conversation that has been removed. A follow-up message is now shown with 2 buttons, one to start a new conversation and another one to close the widget. Their respective new custom text
keys are:
systemPostConversationMessage
systemPostConversationStartButtonLabel
systemPostConversationCloseButtonLabel
offTheRecordOffButtonLabel
offTheRecordOffMessage
offTheRecordOnButtonLabel
offTheRecordOnMessage
sensitiveInformationMessage
custom text
keysholidayMessage
noAgentsMessage
outOfHoursMessage
launchButtonText
splitTextLessButtonLabel
splitTextMoreButtonLabel
The margins of the text of the launchButtonSettings
have been removed.
custom text
keysnetworkWarningMessage
agentAbsentMessage
system
postConversationPrintButtonLabel
custom text
keysessionEndedByAgentAbsentMessage
which has been replaced by agentAbsentMessage but used in a different wayPrior CX version 23A+ you will have to configure WCFS to use the old default file types:
fileUploadSettings: {
supportedFileTypes: 'bmp doc docx gif jpeg jpg pdf png txt xls xlsx'
}
See File Types Restriction for more details.
Default values have been introduced for the following icons, to disable them just clear them as follows:
icons: {
avatarBot: '',
avatarUser: '',
informationMessage: '',
warningMessage: '',
errorMessage: '',
downloadMessage: '' // New icon in 24B
}
See Custom Icons for more details.
custom text
keysagentAttachmentDownloading
agentAttachmentDownloadFailed
custom text
keysagentAttachmentDownloading
has substitution strings for the file name and the file size.custom text
keyspacDialogTitleHtml
pacDialogTextHtml
pacNoButtonLabel
pacYesButtonLabel
sessionEndedByQueueTimeoutMessage
endConversationAndClose
bot
sensitiveInformationMaskingMessage
sensitiveInformationOffTheRecordMessage
sensitiveInformationRemovedMessage
plfFooterHtml
plfHeaderHtml
custom text
keyssensitiveInformationMessage
custom icon
keyssensitiveInformationMessage
offTheRecordOffMessage
offTheRecordOnMessage
name
from oda-chat
to wcfs
disconnectEvent
from unload
to beforeunload
isNewSession
methodThe isNewSession
method has a new optional parameter, for more details see Persistence.
Note that the session object in the browser's session storage has also changed.
offTheRecordPatterns
setting valuesCREDIT_CARD
to creditCard
SOCIAL_SECURITY_NUMBER
to socialSecurity
custom text
keyscclLinkAriaLabel
cclLinkText
The previous hardcoded substitution of {ENGAGEMENT_ID}
has been removed and now requires using the new urlParameters
key. See B2C Survey Integration and URL Customization for more details.