Genesys Web Messaging SDK: Passing CRM ID in startChat() not sticking to conversation

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.

Are you passing the CRM ID in the customAttributes object or just as a flat property on the config? The SDK expects specific nesting.

Here’s the working structure for startChat. You need to map it correctly under customAttributes.

const config = {
 organizationId: 'your-org-id',
 deploymentId: 'your-deployment-id',
 customAttributes: {
 crmId: '12345', // Must be string
 sourceSystem: 'ReactApp'
 },
 contact: {
 name: 'John Doe',
 email: 'john@example.com'
 }
};

genesysCloudMessaging.startChat(config);

If you’re pushing it outside that object, the API ignores it. Also, check your Webhook payload. Custom attributes often arrive in a separate customAttributes array or object depending on the webhook version. Don’t assume they merge into the root contact object. Verify the payload structure in the developer console first.

Yeah, customAttributes is the right spot. Just double check you aren’t mutating the config object after init. Also, make sure that attribute is actually exposed in the Web Messaging configuration in the admin portal, or it gets stripped out server-side.

// Verify exposure in admin UI first