Web Messaging SDK: startChat() attributes not persisting to Studio session

Trying to push a CRM customer ID into the CXone Web Messaging SDK before the chat connects. The goal is to have this ID available in the script immediately upon connection.

I’m using the startChat method with the attributes object as shown below:

const config = {
 siteId: 'my-site-id',
 attributes: {
 customerId: 'CRM-12345'
 }
}

window.cxoneWebMessaging.startChat(config)

The chat connects successfully. No errors in the console. However, when I check the session data in the script using the Get Session Data action, the customerId field is missing or undefined. I’ve also tried adding it via the updateAttributes method after the chat starts, but it still doesn’t show up in the initial session context.

I’ve verified the site configuration allows custom attributes. The attribute name matches exactly. Is there a delay in attribute propagation that I need to account for in the script logic? Or is startChat the wrong method for passing persistent session data to ?