Is it possible to pass a custom CRM customer ID directly through the startChat() method of the Genesys Cloud Web Messaging SDK to ensure it is available in the initial WebSocket connection handshake?
- Current implementation uses the standard JS SDK v1.2.4.
- Attempting to inject
externalCustomerIdvia thedataobject in the configuration. - Code snippet:
const config = {
brandId: 'my-brand-id',
deploymentId: 'my-deployment-id',
data: {
externalCustomerId: 'CRM-998877',
source: 'web-portal'
}
};
messenger.startChat(config);
- Observation:
- The chat initializes successfully.
- WebSocket connection established on
/api/v2/messaging/connections. - However, the
externalCustomerIddoes not appear in the initialconversation/participantspayload received via the Notification API. - It only appears after the first message is exchanged, likely via a subsequent PATCH or attribute update.
- Requirement:
- Need the CRM ID present in the initial participant object to trigger specific routing logic via Architect Data Actions immediately upon connection.
- Routing logic relies on
event.data.participants[0].attributes.externalCustomerId. - Delay in attribute availability causes routing misfires for high-priority CRM segments.
- Questions:
- Is there a specific parameter name required in the
dataobject for immediate attribute propagation? - Should I be using the
customAttributesfield instead of genericdata? - Is this a limitation of the SDK or the backend WebSocket bridge?
- Any known workaround to force immediate attribute sync on
startChat? - Environment:
- Genesys Cloud US01.
- SDK loaded via CDN.
- No custom build of the SDK.