Web Messaging SDK custom guest attributes persisting across sessions

Trying to inject custom attributes into the Genesys Cloud Web Messaging widget for authenticated users. Using the genesyscloud-messaging-widget SDK. I’m calling widget.setCustomAttributes after login, but the attributes show up as null in the Architect flow via webMessage.customAttributes.

const widget = await initWidget({ ... });
widget.setCustomAttributes({ userId: '123' });

The API call to /api/v2/conversations/messages doesn’t reflect these either. Is there a race condition with the session creation?

  • The widget SDK doesn’t sync custom attributes to the platform immediately. You need to trigger a manual update or wait for the next message send.
  • Call widget.updateGuest({ customAttributes: { userId: '123' } }) instead. setCustomAttributes is local-only.
  • Verify the scope includes webmessaging:guest:write. Without it, the patch fails silently on the client side.