Web Messaging widget: custom guest attributes not persisting for authenticated users

Running into a head-scratcher with the Genesys Cloud Web Messaging widget. I’m trying to inject custom guest attributes for authenticated users before the widget initializes, but they’re dropping off somewhere in the handshake. The docs suggest setting them via the onGuestReady callback or passing them in the config object.

I’ve tried both. Here’s the config approach:

genesyscloud.webmessaging.init({
 orgId: 'my-org-id',
 deploymentId: 'my-dep-id',
 guestAttributes: {
 userId: 'user-123',
 accountType: 'premium'
 }
});

And the callback approach:

genesyscloud.webmessaging.onGuestReady((guest) => {
 guest.setAttributes({
 userId: 'user-123',
 accountType: 'premium'
 });
});

The widget loads fine. I can see the conversation start in the Genesys Cloud admin console, but the userId and accountType fields are blank in the conversation details. I’ve checked the network tab, and the initial POST to /api/v2/conversations/messaging doesn’t seem to include these attributes in the payload body. Am I missing a specific API call to sync these after the guest is ready, or is there a known issue with the SDK version 1.2.4? The standard name and email fields work fine, so it’s not a general auth issue.

// Don't pass attributes in the initial config object. 
// They get stripped during the handshake validation.
// Inject them here instead:
genesyscloud.webmessaging.onGuestReady(function(guest) {
 const customAttrs = {
 "user_id": "12345",
 "tier": "gold"
 };
 
 // Update the guest profile directly
 guest.updateAttributes(customAttrs);
});

The config object is read-only for identity fields. If you shove custom keys in there, the parser drops them to prevent spoofing. You need to hook into onGuestReady. That’s the only safe window to mutate the guest profile before the first message sends. Also check your Architect flow. If you’re not pulling those attributes via a Data Action at the start, they won’t show up in your analytics or routing logic. It’s not a widget bug, it’s just timing. The handshake finishes, then the widget loads, then you get the callback. Miss that window and the data is gone. Make sure your org allows external attributes too. Sometimes the admin settings block custom fields from persisting.