Web Messaging SDK startChat() custom attributes not persisting to conversation

Running into a weird issue with the Genesys Cloud Web Messaging SDK where custom attributes passed during initialization aren’t showing up in the conversation object on the platform side.

We’re building a custom embeddable client app. The goal is to inject the CRM customer ID into the chat session so we can trigger screen pops in the agent desktop. I’ve got the SDK loaded and initialized correctly. The chat widget renders fine, and messages flow back and forth without hiccups.

Here’s how I’m calling the start method. I’m passing the customer ID inside the attributes object as documented.

const gcWebMessaging = require('@genesyscloud/webmessaging-sdk');

const client = gcWebMessaging.createClient({
 orgId: 'our-org-id',
 deploymentId: 'our-deployment-id',
 gatewayUrl: 'https://webchat-eu-west-1.genesys.cloud'
});

client.startChat({
 name: 'John Doe',
 email: 'john.doe@example.com',
 attributes: {
 crmCustomerId: 'CUST-998877',
 priority: 'high'
 }
});

I’ve verified the request payload using browser dev tools. The POST to the gateway includes the attributes object with the crmCustomerId key. It looks correct.

However, when I look at the conversation in Genesys Cloud Admin or check the participant data via the API, those custom attributes are missing. The standard fields like name and email populate fine. It’s like the SDK is stripping the custom attributes before sending them to the platform.

I’ve tried:

  1. Changing the key name to crm_customer_id (snake_case) just in case.
  2. Passing the attributes in the options object instead of directly in the start call.
  3. Checking if there’s a specific configuration in the CXone deployment settings that needs to allow custom attributes. The deployment is set to allow custom data.

Is there a specific format required for the attributes object? Or do I need to map these attributes in Architect before they stick? The documentation is a bit vague on this part.

I’m using SDK version 1.12.0. Any pointers?

might be worth checking how you’re structuring the payload for startChat(). I’ve seen this trip people up before. The SDK doesn’t just take a flat object; it expects a specific shape for custom attributes to actually stick to the conversation metadata in Genesys Cloud.

Here’s the pattern that works for me in Node.js integrations pushing to the frontend:

const chatOptions = {
 chatId: 'your-chat-id',
 email: 'user@example.com',
 firstName: 'John',
 lastName: 'Doe',
 // Custom attributes need to be nested under 'customAttributes'
 customAttributes: {
 crmCustomerId: '12345',
 sessionId: 'abc-def-ghi'
 }
};

await webMessaging.startChat(chatOptions);

If you’re passing crmCustomerId at the root level, it gets ignored by the platform’s message processor. It has to be inside that customAttributes object. Also, make sure you’re not hitting the character limit on attribute names or values. Genesys is pretty strict about that.

Another thing to check: are you using the latest version of the Web Messaging SDK? Older versions had a bug where custom attributes wouldn’t persist if the session was resumed. Updating to the latest npm package usually fixes that.

You can verify the attributes are actually being sent by checking the Network tab in your browser’s dev tools. Look for the POST request to /api/v2/conversations/messaging/conversations. The payload should include your customAttributes object. If it’s there but not showing up in the agent desktop, it might be a permissions issue. Make sure the agent’s role has access to view custom attributes.

One more gotcha: if you’re using Architect to route the conversation, make sure you’re not overwriting the attributes in a Data Action. Sometimes people accidentally clear them out by setting the conversation data to a new object without merging the existing custom attributes.

Check your SDK version and payload structure first. That usually solves 90% of these cases.