Purpose

This readme provides information regarding the sample provided here and the differences with the ODA Native Client SDK for Web.

Web Chat For Service 24C is based on Oracle Digital Assistant Native Client SDK for Web release 24.06.

Table of Contents

Sample Files

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:

Examples

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

Settings

Setting Keys

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
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
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
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
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
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:

Updating the Setting Keys

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.

Custom Text Keys

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
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
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 Email 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

Custom Icons

WCFS has introduced default values for the following existing icons:

To clear them just set them as empty strings:

icons: {
    avatarAgent: '',
    avatarBot: '',
    avatarUser: ''
}

Notes:

The following custom icons are specific to WCFS and come with default values:

For more information on how to customize icons go to the ODA Native Client SDK for Web documentation.

Connection Data

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
email email 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:

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' }
    ]
}

Updating the Connection Data

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

Pre-launch Form

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.

Fields

Configure the preLaunchFormFields setting to customize the fields to show in the pre-launch form. The name key is the only required one.

(*) 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'}
]

Labels

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 18i 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 add a header and / or a footer using the following custom text keys:

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>.'
    }
}

Resetting the Pre-launch Form

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

Start-up Behaviour

Use the following values to customize the showPreLaunchForm setting:

Color Customization

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

Persistence

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:

Example:

disconnectEvent: 'pagehide'

File and Location Sharing

To manage file and location sharing use these 4 settings:

Notes:

Maximum File Size

B2C Service

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.

Fusion Service

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
}

File Types Restriction

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.

B2C Service

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

Fusion Service

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
}

Download Behavior

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

Attachment Mode agentAndBotSkill

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:

Simple examples that illustrate how enableFileSharing works:

  # 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"
  # 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"

Message Types

System Message

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):

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.

Post Conversation 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:

Type message

When the conversation is ended the message associated to the text key postConversationMessage is shown.

Example:

enablePostConversationMessage: true,
postConversationMessageOptions: {
    type: 'message'
}

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/'
}

Type 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 Survey Integration

The chat engagement id needs to be added to the survey link to connect the survey with the chat and WCFS will replace the string {ENGAGEMENT_ID} with the actual value.

Note that the following needs to be added within the survey link: "/6/233/7/{ENGAGEMENT_ID}. More info.

Example for link, it also works for iframe:

postConversationMessageOptions: {
    type: 'link',
    url: 'http://acme.custhelp.com/ci/documents/detail/5/11/6/223/7/{ENGAGEMENT_ID}/12/245cfe1718889dd43ee26d6654e354af8331c668)'
}

Conversation Printing

To enable the print button 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.

Multilingual Support

B2C

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'

Fusion

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'

ODA Skill Languages

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: "..."  

multiLangChat Setting

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.

Conditional Launch Button

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:

Queue Parameters

You can fine tune the call by setting these parameters:

Example:

conditionalLaunchButton: 'liveAgent',
conditionalLaunchButtonDetails: {
    queueId: 23
}

Availability Conditions

You can fine tune the availability condition with the following parameters by setting conditionalLaunchButtonDetails to custom and set one or more of these parameters:

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:

conditionalLaunchButton: 'liveAgent',
conditionalLaunchButtonDetails: {
    categoryId: 23
}
conditionalLaunchButton: 'custom',
conditionalLaunchButtonDetails: {
    minAgentSessions: 1
    categoryId: 23
}

Polling

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
}

Updating the conditionalLaunchButtonDetails

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.

Examples

conditionalLaunchButton: 'liveAgent',
conditionalLaunchButtonDetails: {
    categoryId: 45
}
conditionalLaunchButton: 'custom',
conditionalLaunchButtonDetails: {
    enablePolling: true,
    queueId: 33,
    maxWaitSeconds: 300
}

Proactive Chat

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.

Dialog Customization

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>

Custom Text Keys

The dialog can be customized with the following custom text keys as shown in the above dialog schema:

Styling

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:

Classes

A string containing one ore multiples classes can be passed to the classes attributes:

proactiveChatDialogCss: {
    dialogClasses: 'dialog-class base-class'
}
Styles

An array of name–value pairs can be passed to the styles attribute:

proactiveChatDialogCss: {
    dialogStyles: [
        {name: 'padding', value: '0px'},
        {name: 'border-color', value: 'darkgray'}
    ]
}

Page Launch Alternative

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'}
    ]
}

Additional Launch Button Settings

Custom Text

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
}

Styling

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'}
    ]
}

Message Text Splitting

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:

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}'
}
splitText: 'hardPosition',
splitTextSettings: {
    position: 100
}
splitText: 'softPosition',
splitTextSettings: {
    position: 100
}

Notes

splitText: 'softPosition',
splitTextSettings: {
    tag: '{split}',
    position: 100
}

Bot and Agent Name Customization

You can customize the name of the bot and the name of the agent in the conversation. Use the following setting keys:

Set them to one of these values:

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'

Bot and Agent Client Greeting

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.

Notes:

B2C Page Peek and Visitor Browser History

B2C Page Peek and Visitor Browser History are available when using Engagement Engine to invoke WCFS and no settings are required for these features.

Authorization

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.

Multiple Bots

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.

Off the Record and Sensitive Information

Off the Record

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.

Sensitive Information

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:

Off the Record

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.

Masking

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:

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

End Conversation

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)

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.

Styling

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:

Scripting

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

Other Restrictions

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.

Upgrading

From 23.02 to 23.04

Location Sharing

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.

Custom Fields

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'}
    ]
}

From 23.04 to 23.06

Fusion Service Version

The serviceVersion setting used for Fusion is not required anymore and has been removed.

End Session Messages

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:

Off the Record Messages

From 23.06 to 23.08

New custom text keys

From 23.08 to 23.10

launchButtonSettings

The margins of the text of the launchButtonSettings have been removed.

From 23.10 to 23.12

New custom text keys

Deprecated custom text key

From 23.12 to 24B

B2C Upload File Types

Prior 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.

Custom icons

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.

New custom text keys

Changed custom text keys

From 24B to 24C

New custom text keys

Changed custom text keys

New custom icon keys

Changed default settings

Changed isNewSession method

The 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.

Changed offTheRecordPatterns setting values