We are trying to pipe the external CRM customer ID into the Genesys Cloud Web Messaging SDK before the session opens for our US/Eastern compliance queue. The routing rules depend on that identifier matching exactly what we log in the database. I’ve been looking at the startChat method documentation but the payload structure isn’t clear for custom attributes. The widget initializes fine and the agent receives the message. Metadata stays empty though when we pull it through the analytics endpoint. Honestly the documentation skips over this part. I tried adding a customer_id field directly inside the configuration object but the SDK just ignores it without throwing a validation error. The compliance team needs this value attached before the first message hits the queue so the routing logic can apply the correct compliance wrapper. I’ve read through the guest API docs and seen mentions of startChat accepting a config object, but I keep getting back a default session without the identifier. Is there a specific key name required inside the startChat payload or do we need to call a separate endpoint to attach the ID after the session spins up. The script below shows what I’m currently feeding into the SDK initialization. The response object returns a session token but the attributes never stick to the conversation object when we query it later. I don’t know if the SDK strips unknown keys before sending the payload to the guest endpoint or if I’m just missing a required parameter in the config. I just need the exact key structure that survives the payload validation.
const guestSession = await guest.startChat({
config: {
widgetId: 'a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8',
customAttributes: {
crm_customer_id: 'CRM-992841',
compliance_tier: 'high'
}
}
});