I’m trying to deploy the Genesys Cloud Web Messaging widget on our internal portal. The goal is to pass custom guest attributes so that when an authenticated user starts a chat, the agent can see their internal ID and role without asking. I’ve got the basic widget loaded and working for anonymous visitors, but the custom data isn’t sticking when we switch to the authenticated flow.
I’m using the genesyscloud-webrtc SDK version 2.4.1. Here’s the initialization code I’m using in the frontend React component:
import { WebMessaging } from '@genesyscloud/web-messaging';
const initMessaging = () => {
const widget = new WebMessaging({
deploymentId: 'abc-123-def',
organizationId: 'org-xyz',
locale: 'en-GB'
});
widget.configure({
guestAttributes: {
'custom.internalId': '10492',
'custom.userRole': 'premium'
}
});
widget.start();
};
The widget loads fine. When I inspect the network tab, I see the POST /api/v2/conversations/messaging request going out. The JSON payload looks correct:
{
"to": { "id": "queue-id" },
"guestAttributes": {
"custom.internalId": "10492"
}
}
But when the agent picks up the conversation, those attributes are missing from the participant object. The agent only sees the default email and name fields. I’ve checked the guestAttributes schema in the Genesys Cloud admin console and confirmed those keys are allowed.
Is there a specific order I need to call configure and start? Or maybe I need to use a different API endpoint to update the guest attributes after the conversation starts? I’ve tried using widget.updateGuestAttributes() after the session begins, but that throws a TypeError: widget.updateGuestAttributes is not a function.
Any ideas on why the attributes aren’t persisting? I’m running this in a staging environment with timezone set to Europe/London.