Web Messaging SDK: Custom guest attributes not persisting after login

Hey folks,

Trying to attach custom attributes to the Genesys Cloud Web Messaging widget for authenticated users. I’m calling genesyscloud.setGuestAttributes() after our SSO login completes, passing a JSON object like { "userId": "123", "tier": "gold" }. The console shows no errors, but when I check the conversation details in the Admin UI, those attributes are blank. The built-in name field works fine, though.

Is there a specific timing issue with the SDK init? Or do I need to hit a separate API endpoint to patch the guest profile before the conversation starts?

Here’s the snippet I’m using:

genesyscloud.setGuestAttributes({
 userId: currentUser.id,
 tier: 'gold'
});

Checked the network tab and the POST to /api/v2/conversations/messaging/... doesn’t include the custom data.

setGuestAttributes runs locally. It doesn’t push to the backend. You need a Data Action or REST Proxy call to update the participant.

fetch('https://api.mypurecloud.com/api/v2/conversations/messaging/participants/{participantId}', {
 method: 'PATCH',
 headers: { 'Authorization': 'Bearer ' + token },
 body: JSON.stringify({ customAttributes: { userId: '123' } })
});

Check the scope on that token too.