I’m completely stumped as to why custom guest attributes are not persisting when initializing the Genesys Cloud Web Messaging widget for authenticated users. I am running this on Node.js 18 with the @genesyscloud/purecloud-guest-sdk version 2.1.0.
The setup involves passing a JSON payload via the guestContext option before the widget connects. Here is the initialization code:
const widgetConfig = {
organizationId: 'my-org-id',
deploymentId: 'my-deployment-id',
guestContext: {
attributes: {
'userId': 'auth-123',
'tier': 'premium',
'source': 'web-app'
}
}
};
const guest = new GuestWidget(widgetConfig);
guest.start();
When I inspect the conversation in the Admin UI, the userId and tier attributes are completely missing. The source attribute sometimes appears but is often null. The console logs show a successful 200 OK on the /api/v2/conversations endpoint, but the payload sent to the server seems to strip the guestContext object entirely.
Is there a specific scope or configuration flag required to allow custom attributes in the guest context? Or is this a known limitation with the current SDK version where only standard attributes like name and email are supported?