refactoring our self-service portal to ensure that the CRM customer ID is correctly attached to the web chat session before it transitions to a live agent. The requirement is strict: the customerId attribute must be populated in the Genesys Cloud conversation context so that our Architect flow can retrieve it via the GetConversationDetails data action.
I have implemented the Genesys Cloud Web Messaging SDK on our React frontend. I am attempting to inject the customer ID using the startChat method with the data parameter. The code looks like this:
const customerId = "CRM-8842-XJ";
genesysCloudWebMessaging.startChat({
flowId: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
data: {
customerId: customerId,
source: "portal-refactor"
}
});
The chat initiates successfully, and the UI renders without errors. However, when the agent receives the conversation, the custom attribute customerId is missing from the participant context in the Genesys Cloud admin view. I have verified that the flow ID is correct and that the flow is published. I also checked the browser console for any network errors during the handshake, but the WebSocket connection establishes cleanly with a 101 Switching Protocols response.
I suspect that the data object in startChat might only be used for initial routing logic and not persisted to the participant profile, or perhaps I need to use a different method like updateAttributes after the session is established. I tried calling updateAttributes immediately after startChat, but the SDK throws a SessionNotActive error if called too early.
Has anyone successfully passed CRM identifiers through the startChat payload? Is there a specific attribute name mapping required on the Genesys Cloud side for these to appear in the agent desktop, or does the SDK require a different approach to bind external IDs to the guest participant?