Dialogue Cloud

Setting the user data

Note Additional Anywhere365 WebAgent license required.

Note Enterprise license and higher

Note: The WebChat needs to be fully loaded before this can be called, Learn More

Introduction

At any point, a user’s name and available endpoint may be registered in the WebChat so that the WebAgent it is connected to will be able to use this data to query the CRM in order to show the matching customer information.

 

Configuration

This can be accomplished with the following call:

Copy
Script
WebChat.setUser('endpoint@domain.com', 'Username');

The username is optional and, when omitted, will be generated by the WebChatDialogueProvider. Without this call the WebAgent will show it is connected to an anonymous user.

Warning: This method can be called from the console as well, so it should not be blindly trusted and extra verification is advised!

 

Example

Below an example script that can be loaded into your website's html. In this example we loaded a webchat and set a email and username:

Copy
HTML
<script>
    WebChat.load();
    window.addEventListener('WebChatLoaded', function() {
        WebChat.setUser('endpoint@domain.com', 'Username');
    });
</script>