Web Messaging SDK: Setting custom guest attributes for logged-in users

Hey everyone,

I’m trying to push custom attributes from our web portal into the Genesys Cloud Web Messaging widget. The goal is to pass the user ID so we can look up their history. I’m using the Messaging.setGuestAttributes method.

Here is the code:

Messaging.setGuestAttributes({
 "userId": "12345",
 "email": "test@example.com"
});

The console doesn’t show errors, but the attributes aren’t showing up in the conversation details in the admin UI. Am I missing a step?

setGuestAttributes only works for anonymous guests. For logged-in users, you need to call Messaging.setAuthenticatedUser with a JWT signed by your backend, otherwise Genesys ignores the custom data as a security measure.