Please note that this SDK relates to LivePersons legacy chat product which receives limited support and will be deprecated in the future.

It is recommended to build future integrations on top of the corresponding messaging SDK instead.

This updates the visitor's name in the chat. The response echoes the original request data.

Note: If the visitor's name is the same as the currently registered name for the chat, the request will be ignored.

Request

Properties

Value Description Type
visitorName The visitor's name. string

Sample code

var failedRequest = myChat.setVisitorName({
    visitorName: "Phil",
    success: myChat.nameUpdated,
    error: myChat.nameUpdateFailed,
    context: myChat
});

if(failedRequest && failedRequest.error){
    alert(failedRequest.error);
}

Response

Sample response

{ "visitorName" : "Phil" }