How to identify a contact in the chat?

This solution for this.

1. Follow this link to update identify visitor:

window.hsConversationsSettings = {
 identificationEmail: "visitor-email@example.com",
 identificationToken: "<TOKEN FROM STEP 1>"
};

2. Call clear function to refresh chatbox identify.

window.HubSpotConversations.clear({resetWidget:true});

It work perfert for me, hoping helpful to you.