We’re integrating the Genesys Cloud Web Messaging SDK into our React frontend. The goal is to pass authenticated user data (email, user ID) to CXone so scripts can access them via GetRESTProxy or direct attribute binding.
The widget initializes fine. Messages go through. The problem is the guest attributes.
We’re calling genesys.cloud.web.messaging.setGuestAttributes right after init.
const config = {
orgId: 'my-org-id',
clientId: 'my-client-id',
region: 'us-east-1',
locale: 'en-US'
};
genesys.cloud.web.messaging.init(config);
// Attempting to set attributes
genesys.cloud.web.messaging.setGuestAttributes({
'user.email': 'test@example.com',
'user.id': '12345'
});
In the CXone Admin UI, under the current conversation, the attributes show up briefly. But when I try to read them in a script using a GetRESTProxy action to fetch interaction data, or even just binding to a variable in a flow, the values are empty.
I’ve checked the network tab. The POST to /api/v2/conversations/messaging/interactions includes the attributes in the payload initially. But subsequent updates don’t seem to carry them over, or maybe the SDK is resetting the session context.
Here’s what I’ve tried:
- Moving the
setGuestAttributescall into theonReadycallback. No change. - Using the REST API directly via a backend proxy to update the guest attributes on the interaction ID. This works. The attributes stick. So the issue seems isolated to the SDK’s client-side setting.
- Checking for CORS errors. None.
Is there a specific sequence required? Does the SDK require the conversation to be in a certain state before accepting attributes? Or is this a known bug with the latest SDK version (2.1.4)?
The documentation is light on this. It just says “set attributes”. Doesn’t mention persistence or timing.
We need this to work client-side so we don’t have to build a backend bridge for every attribute update. That adds too much latency and complexity.
Any ideas on why the SDK set isn’t sticking?