We’ve noticed a weird bug where the custom attribute we pass during the chat start doesn’t actually show up in the Genesys Cloud supervisor view or the webhook payload.
I’m working on a React wrapper around the Genesys Web Messaging SDK (version 1.2.4). The goal is simple: when a user clicks “Chat,” we grab their CRM ID from our local store and push it into the conversation so the agent sees it immediately.
Here is the code block I’m using to initialize and start the chat:
import GenesysCloudWebMessagingSdk from '@genesys/web-messaging-sdk';
const sdk = new GenesysCloudWebMessagingSdk({
brandId: 'our-brand-id-here',
locale: 'en-US'
});
const startConversation = async () => {
const crmId = localStorage.getItem('crmCustomerId');
await sdk.startChat({
attributes: {
crmId: crmId || 'unknown',
source: 'web-portal-v2'
},
customAttributes: {
externalRef: crmId
}
});
};
The chat starts fine. The UI renders. But when I check the conversation details in the Genesys admin UI, the attributes object is empty. I also hooked up a simple Node.js webhook listener on /api/v2/webchat/conversations/webchat and the customAttributes field is missing from the JSON payload entirely.
I tried adding the attributes to the startChat options as shown above, but nothing sticks. I also tried setting them via sdk.setAttributes() before calling startChat, but that method doesn’t seem to exist on the instance.
Is there a specific format for the attributes object in startChat? Or do I need to make a separate REST call to /api/v2/conversations/messages right after the chat starts to inject this data? The docs are pretty vague on where the data actually lands.
I’m on US/Central time if anyone needs to check server logs.